Workflow tool: args passed as a JSON array reaches the script as a JSON-encoded string
Environment
- Claude Code v2.1.207, macOS (darwin 25.5.0)
- Model: claude-fable-5
Bug
The Workflow tool's args parameter documents: "Pass arrays/objects as actual JSON values in the tool call, NOT as a JSON-encoded string". The model passed an actual JSON array in the tool call, e.g.:
{"script": "...", "args": [{"filename": "a.pdf", "pages": 73}, {"filename": "b.pdf", "pages": 58}]}
but the script received args as a JSON-encoded string, so the first line of the body threw immediately:
TypeError: pipeline() expects an array as the first argument
at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:6329:4055)
The failure notification's recovery hint itself shows the stringified form (args: "[{\"filename\": ...}]"), suggesting the harness serializes args somewhere between the tool call and the script sandbox.
Expected
args should reach the script as the same JSON value that was passed in the tool call (the tool description explicitly warns the model not to stringify — but the stringification happened harness-side).
Workaround
Defensive parse at the top of every workflow script:
const FILES = typeof args === 'string' ? JSON.parse(args) : args
Impact
Any workflow relying on args.map/args.filter fails on first run; the meta/phases validation passes so the failure only surfaces at runtime.