feat(agents): Draw the run canvas as a real dispatch tree - #121
Merged
Merged
Conversation
Every session of a run shared one runId, and a worker's own `codedeck run` inherited it, so the pane drew every worker as a child of an "Orchestrator" card. Sessions now record parentId (from CODEDECK_SESSION_ID, falling back to CODEDECK_RUN_ID) and role, and the pane hangs each card from the session that dispatched it, labelling the root with its real role. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QuWLN5K2HAo94s16Bb9HRU
|
This was referenced Sep 25, 2026
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.



Summary
Every session in a run shared one
runId, theopensession's id. When a worker rancodedeck runitself, the child inherited that sameCODEDECK_RUN_ID. The agents pane showed every worker as a direct child of a card with a hardcoded "Orchestrator" label. So a reviewer started by ageneralworker looked like the root had started it.This PR records lineage and draws it as a tree.
parent_idandrolecolumns onsessions. They are added to existing databases throughaddMissingColumns.codedeck run: sendsparentId, taken fromCODEDECK_SESSION_ID(which every worker harness already has) or elseCODEDECK_RUN_ID, plusrole = parseRole(--role).open: setsCODEDECK_SESSION_IDto its own id and sends its role onsession.adopt.parentIdonly when that session exists in the store. When the request has norunId, it inherits the parent's.plugin/mods/agents/pane.ts):← parent.Spec:
.specs/features/worker-lineage/spec.md.Notes
parentId, so the pane draws them under the root.Test plan
npm run buildtests/daemon-lineage.test.ts, the lineage cases intests/mods-agents/pane.test.ts, and the parent/role cases intests/run-role.test.tsvitest run: 1573/1574. The one failure, intests/open-claude-probes.test.ts, fails the same way on the base branchscripts/pty-gate.sh🤖 Generated with Claude Code
https://claude.ai/code/session_01QuWLN5K2HAo94s16Bb9HRU
Generated by Claude Code