Skip to content

feat(subagents): state the delegation on its row, not the child's reply - #20

Merged
ericleepi314 merged 1 commit into
mainfrom
delegation-summary
Aug 19, 2026
Merged

feat(subagents): state the delegation on its row, not the child's reply#20
ericleepi314 merged 1 commit into
mainfrom
delegation-summary

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

What

A delegation's row carried the child's entire answer. That text is addressed to the model — the parent reads it and writes its own reply — so the row restated work the reader had not asked to see, at whatever length the child felt like.

before                                          after
⏺ Subagent(List the sources)                    ⏺ Subagent(List the sources)  (/agents to monitor)
  ⎿  echo: PROBE bash {"command": "sleep 4         ⎿  Done (1 tool use · 27 tokens · 4s)
     && ls -1 src | head -3", "description":
     "peek at src"}                             ⏺ Subagent(Audit the tests)  (/agents to monitor)
                                                  ⎿  Backgrounded agent

Claude Code renders ⎿ Done (2 tool uses · 48.0k tokens · 11s) for a foreground Task and ⎿ Backgrounded agent for a backgrounded one.

Where the counts come from

The child's own session log, which #19 started reading — and only when the join is unambiguous: exactly one delegation in flight and exactly one child settled under it.

The harness's own prompt tells a model to "start independent delegations together in one assistant message", so attributing one child's tokens to another's row would be worse than reporting only the time this call took — which is always this call's own. A parallel delegation therefore still gets Done (4s), with a test pinning that.

The child's reply stays one ctrl+o away. The parent model read it; so can the reader.

Test

  • npm run typecheck, npm test — 150 files / 1938 passing
  • node scripts/verify-boundary.mjs
  • three new cases: foreground summary + reply behind ctrl+o, backgrounded wording, and the two-in-flight fallback
  • live captures via scripts/tool-gallery.py subagent subagent_working subagent_background

🤖 Generated with Claude Code

A delegation's `⎿` row carried the child's entire answer. That text is
addressed to the MODEL — the parent reads it and writes its own reply — so
the row restated work the reader had not asked to see, at whatever length
the child felt like.

The original states the delegation itself:

    ⏺ Subagent(List the sources)  (/agents to monitor)
      ⎿  Done (1 tool use · 27 tokens · 4s)

    ⏺ Subagent(Audit the tests)  (/agents to monitor)
      ⎿  Backgrounded agent

The counts come from the child's own log, which the previous change
started reading, and only when the join is unambiguous: exactly one
delegation in flight and exactly one child settled under it. The harness's
own prompt tells a model to start independent delegations together, and
attributing one child's tokens to another's row would be worse than
reporting only the time this call took — which is always this call's own,
so a parallel delegation still gets `Done (4s)`.

The child's reply stays one ctrl+o away. The parent model read it; so can
the reader.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ericleepi314
ericleepi314 merged commit 8b19cc6 into main Aug 19, 2026
1 check passed
@ericleepi314
ericleepi314 deleted the delegation-summary branch August 19, 2026 09:30
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