Skip to content

feat(subagents): the delegation tree had no data source at all - #19

Merged
ericleepi314 merged 1 commit into
mainfrom
subagent-tree
Aug 19, 2026
Merged

feat(subagents): the delegation tree had no data source at all#19
ericleepi314 merged 1 commit into
mainfrom
subagent-tree

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

What

Delegating produced one row and nothing else. /agents said "No subagents this turn" for the whole session, the busy line never showed a delegation, spawn history stayed empty. The bridge emitted no subagent events — the word does not appear in it — so every delegation surface the TUI already ships was drawing an empty list.

Live capture, /agents opened while a child is working:

before                                after
Spawn tree   d0 · 0 agents            Spawn tree   d1 · 1 agent · 1 tool · ⚡1  █  · inherit×1

No subagents this turn.               #1 ● List the sources
Trigger delegate_task to
populate the tree.                    depth · 0 · running
                                      tools · 1 (subtree 1)
                                      ▾ Tool calls (1)
                                      · Bash(sleep 20 && ls -1 src | head -3)

Where the data comes from

The harness publishes the whole lifecycle, and the instrumented run confirms every edge:

  • subagent/start / subagent/end — the child's session id and its terminal outcome
  • the child's own session log rides the same bus: subagent/descriptor names the delegation, its tool/calls are its work, its assistant/messages carry its usage

Correlation is by child session id, never arrival order

The harness's own guidance tells a model to "start independent delegations together in one assistant message", so pairing a child with its call by order would attribute one delegation's work to another the moment two run at once. The child's id appears on both lifecycle edges and on every event its session emits, so nothing is guessed.

A session the bridge was never told is a child is ignored outright — a sibling top-level session on the same bus cannot leak into this transcript. There is a test for exactly that.

The row the tree hangs from

Both the inline tree and the (/agents to monitor) hint tested label.startsWith('Delegate Task') — upstream's tool name, which the harness does not use. That vocabulary now lives with the rest of it in domain/toolBrief, covering Agent / Task / Delegate Task and the harness's subagent / subagent_fork.

Test

  • npm run typecheck, npm test — 150 files / 1935 passing
  • node scripts/verify-boundary.mjs
  • five new cases: the start edge opens a row, the descriptor names it, the child's tool calls are reported, the close carries cost + answer, and an unrelated session is ignored
  • new subagent_working gallery scenario + a --live flag, so the tree can be captured mid-flight

@deepseek-ai/dsh-subagent is added as a type-only devDependency, the same way dsh-plan-mode already is — it activates the lifecycle Events and the subagent/descriptor session-event augmentation.

🤖 Generated with Claude Code

Delegating produced one row and nothing else: `/agents` said "No
subagents this turn" for the whole session, the busy line never showed a
delegation, and spawn history stayed empty. The bridge emitted no subagent
events — the word does not appear in it — so every surface the TUI already
ships for delegation was drawing an empty list.

The harness publishes the whole lifecycle. `subagent/start` and
`subagent/end` carry the child's session id and terminal outcome, and the
child's own session log rides the same bus: its `subagent/descriptor`
names the delegation, its `tool/call`s are its work, its
`assistant/message`s carry its usage. Translating those gives the tree
everything it draws.

Correlation is keyed on the child's session id, never on arrival order.
The harness's own guidance tells a model to start independent delegations
together in one message, so pairing a child with its call by order would
attribute one delegation's work to another the moment two run at once. A
session the bridge was never told is a child is ignored outright, so a
sibling top-level session on the same bus cannot leak into this
transcript.

The row the tree hangs from also had to be recognizable. Both the inline
tree and the `(/agents to monitor)` hint tested `label.startsWith('Delegate
Task')` — upstream's tool name, which the harness does not use. That
vocabulary now lives with the rest of it in domain/toolBrief, covering
Agent/Task/Delegate Task and the harness's subagent/subagent_fork.

Live capture, `/agents` while a child works:

    Spawn tree   d1 · 1 agent · 1 tool · ⚡1  █  · inherit×1
    #1 ● List the sources
    depth · 0 · running
    tools · 1 (subtree 1)
    ▾ Tool calls (1)
    · Bash(sleep 20 && ls -1 src | head -3)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ericleepi314
ericleepi314 merged commit 60ce16f into main Aug 19, 2026
1 check passed
@ericleepi314
ericleepi314 deleted the subagent-tree branch August 19, 2026 09:26
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