[BUG] Workflow tool: synthesis agent() returns placeholder schema values instead of real output on large aggregated input
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using the Workflow tool with a fan-out-then-synthesize pattern (N parallel
reader agent() calls, each returning a structured JSON result, followed by one
final agent() call that synthesizes all of them via a complex nested required
schema), the synthesis call sometimes returns literal placeholder/schema-example
values instead of a genuine synthesized answer -- even after consuming a large
number of tool calls and tokens.
Observed output from a real run: {"sketch":"test","lockedConstraints":
[{"fact":"a","evidence":"b"}],"exactTemplate":"test","grill":[]}
This is not an empty/error result -- it's a fully schema-valid StructuredOutput
call, just with trivial "test"/"a"/"b" style content, as if the model had
validated the tool call shape with placeholder values and then let that stand
as the final answer rather than doing the actual synthesis.
What Should Happen?
The synthesis agent should either produce a genuine answer that reflects the
actual input data, or fail/surface an error -- it should never silently return
placeholder content that happens to satisfy the schema.
Error Messages/Logs
Final workflow result:
{"summary":"...","agentCount":6,"result":{"sketch":"test","lockedConstraints":
[{"fact":"a","evidence":"b"}],"exactTemplate":"test","grill":[]}}
Synthesis agent stats (from workflowProgress): tokens: 107161, toolCalls: 13,
state: "done" (no error surfaced). The 5 upstream reader agents all completed
successfully with substantive, correct results (verified by reading their
individual agent-<id>.jsonl transcripts directly) -- only the final synthesis
call produced junk, despite consuming far more tokens/tool-calls than a
text-only synthesis task should need.
Steps to Reproduce
- Use the Workflow tool with a script of this shape:
const reads = await parallel([
() => agent('<research prompt 1>', {schema: READ_SCHEMA, agentType:'Explore'}),
() => agent('<research prompt 2>', {schema: READ_SCHEMA, agentType:'Explore'}),
// ... 5 total readers, each returning a schema with verbose string fields
])
const out = await agent(
'Synthesize these findings: ' + JSON.stringify(reads),
{schema: SYNTH_SCHEMA, effort:'high'}
)
return out
- SYNTH_SCHEMA should be a nested schema with multiple required array-of-object
fields (e.g. lockedConstraints[{fact, evidence}], grill[{question,
whyItMatters, options, recommendedDefault}]).
- Make the 5 reader results individually substantial (each doing real
multi-tool-call research with verbatim-quote-heavy findings), so
JSON.stringify(reads) fed to the synthesis prompt is large (tens of
thousands of tokens).
- Observe: the synthesis call sometimes burns many tool calls/tokens, then
returns a StructuredOutput that is trivially placeholder ("test", "a", "b")
rather than reflecting the actual input.
Note: not yet confirmed deterministically reproducible -- this is a real
production occurrence, not a minimized/isolated repro.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.185
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
used claude-sonnet-5 (synthesis call) / claude-haiku-4-5-20251001 (reader subagents, via agentType:'Explore')