Skip to content

feat(events): id + result text on workflow subagent tool events - #344

Merged
justrach merged 1 commit into
mainfrom
feat/subagent-event-ids
Aug 1, 2026
Merged

feat(events): id + result text on workflow subagent tool events#344
justrach merged 1 commit into
mainfrom
feat/subagent-event-ids

Conversation

@justrach

@justrach justrach commented Aug 1, 2026

Copy link
Copy Markdown
Owner

What

Workflow subagent tool_call/tool_result events carried neither an id nor the child's report: a --json consumer rendering the live agent tree could only pair parallel rows by arrival order, and an errored row had no reason to show.

  • Both events now carry the sa- id that agent_usage already emits, so a consumer can pair tool_calltool_resultagent_usage explicitly.
  • tool_result now carries the report head (600 chars) or, on error, agent.last_api_error / a fallback marker.
  • Both optional fields documented in the --schema protocol events list.

Provenance

Port of June's bb090f1 (feat/live-agent-tree, stale-branch triage) 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 (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 test green locally (Zig 0.16); CI on the pinned 0.17 nightly gates the merge.

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>
@justrach
justrach merged commit 85b2339 into main Aug 1, 2026
6 checks passed
@justrach
justrach deleted the feat/subagent-event-ids branch August 4, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant