You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: _resolve_placeholders crashes with IndexError on positional format placeholders like {0} #154
`_resolve_placeholders` in `workflows/workflow_use/workflow/service.py` only catches `KeyError` when calling `str.format(**context)` on a string that contains placeholder syntax. When the string contains a positional format specifier such as `{0}` (common in copy-pasted JSON values, URL templates, or CSS strings), Python raises `IndexError: Replacement index 0 out of range for positional args tuple` instead of `KeyError`. This exception is not caught, so the workflow crashes entirely.
How to trigger
Any workflow step whose `value` (or any other string field) contains a numeric format specifier, for example:
causes the crash at runtime during placeholder resolution.
Traceback
```
Traceback (most recent call last):
File "service.py", line 517, in _resolve_placeholders
formatted_data = data.format(**self.context)
IndexError: Replacement index 0 out of range for positional args tuple
```
Fix
Catch `(KeyError, IndexError)` instead of just `KeyError` in the `except` clause of `_resolve_placeholders`.
Activity