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
bt trace import claude loses the result of workflow agents that return structured output #316
A workflow agent() call with a schema returns its result as the input of a final StructuredOutput tool call. The import sets the agent's span output from its last
assistant text instead. That's empty or a stale line from earlier in its work, so the
result is lost.
Impact
On one engineer's machine, 27 of 29 workflow agents end with StructuredOutput: 7 have no
output in their span, and 20 show a stale line. The trace shows the workflow's agents but
not what they returned.
Steps to reproduce
In a git repository with src/a.txt, src/b.txt and src/c.txt (Claude Code 2.1.311):
claude -p --model haiku --allowedTools "Workflow Glob Read Agent" --output-format json "ultracode: use a workflow with two parallel agents. Give each agent() call a schema option so it returns structured output: the first lists the files in src/ with Glob and returns {files: string[]}, the second reads src/b.txt and returns {contents: string}. Report what each returned."
bt trace import claude <session-id>
On disk: the two agents' transcripts under subagents/workflows/wf_…/ end with StructuredOutput {"files": ["src/a.txt", "src/b.txt", "src/c.txt"]} and StructuredOutput {"contents": "file b\n"}, with no text after them.
Today: both subagent: workflow-subagent spans have output: null.
Expected: each span's output is its structured result.
We ran it with bt 0.33.0 into a Braintrust project, and read the stored trace back with bt sql. A debug build of bt-daemon at dc5f7ea gives the same result.
Treat a successful final StructuredOutput like SubagentHandback. Its input
becomes the agent's output. That extends the hand-back lookup that already exists.
Prefer the agent's result from the workflow's own record, if the run's summary holds
each agent's return value. We haven't checked whether it does.
Activity