feat(events): id + result text on workflow subagent tool events - #344
Merged
Conversation
Workflow subagent tool_call/tool_result events carried neither an id nor the child's report, so a --json consumer rendering the live agent tree could only pair parallel rows by arrival order and had no failure reason to show. Reuse the sa- id agent_usage already emits on both events, and put the report head (or the API error) on tool_result. Port of June's bb090f1 (feat/live-agent-tree) onto the split-out subagent_run.zig, switched from that commit's call_id to the id field the protocol already uses for subagent identity. Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Workflow subagent
tool_call/tool_resultevents carried neither an id nor the child's report: a--jsonconsumer rendering the live agent tree could only pair parallel rows by arrival order, and an errored row had no reason to show.sa-id thatagent_usagealready emits, so a consumer can pairtool_call→tool_result→agent_usageexplicitly.tool_resultnow carries the report head (600 chars) or, on error,agent.last_api_error/ a fallback marker.--schemaprotocol events list.Provenance
Port of June's bb090f1 (
feat/live-agent-tree, stale-branch triage) onto the split-outsubagent_run.zig. Switched from that commit'scall_idto theidfield the protocol already uses for subagent identity (agent_usage.id).GUI-side pairing by id is deliberately not included — the GUI's positional pairing keeps working since event order is unchanged; consuming the id there can ride the GUI polish assessment.
Testing
zig build testgreen locally (Zig 0.16); CI on the pinned 0.17 nightly gates the merge.