Repository navigation
fix(coding-agent): bind spawn provenance to the selected branch - #145
Merged
Issacboy123 merged 2 commits intoAug 29, 2026
Merged
Issacboy123 merged 2 commits into
Issacboy123 merged 2 commits into
Conversation
Pepps233
approved these changes
Aug 29, 2026
Issacboy123
force-pushed
the
fix/bind-selected-branch-spawn-origin
branch
from
August 29, 2026 10:37
c4bb46b to
215e46d
Compare
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
Spawn provenance searched all persisted entries, so reused tool-call identifiers could bind a child to an older or abandoned assistant turn. This PR resolves the origin from the newest matching
spawn_agentcall on the currently selected branch while retaining fail-closed behavior when no match exists.Reasoning
The selected branch is the authoritative history for the active model call. Traversing it newest first handles identifier reuse without changing stored sessions or requiring globally unique IDs, and matching the tool name as well as the identifier prevents collisions with other tools. Keeping the no-match rejection avoids inventing provenance when current history cannot support it.
Changes
spawn_agenttool name to match.Testing
node ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-registration.test.tsnode ../../node_modules/vitest/dist/cli.js --run test/suite/agent-session-prompt.test.ts test/suite/subagent-services.test.ts test/suite/subagent-registration.test.ts test/suite/subagent-coordination.test.ts test/suite/subagent-parent-messaging.test.ts test/subagent-controller.test.tsnode ../../node_modules/vitest/dist/cli.js --run test/session-manager/tree-traversal.test.tsnpm run check