Skip to content

feat(coding-agent): reconcile subagents across context changes - #121

Merged
Issacboy123 merged 2 commits into
feat/restore-persistent-subagentsfrom
feat/reconcile-persistent-subagents
Aug 28, 2026
Merged

Issacboy123 merged 2 commits into
feat/restore-persistent-subagentsfrom
feat/reconcile-persistent-subagents

Conversation

@Issacboy123

@Issacboy123 Issacboy123 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keeps subagents aligned with the parent session when users switch branches or reset context. Active children are stopped safely before the parent context changes, and the subagent list is replaced with the one saved for the destination branch. If Diffex cannot safely stop the children or record a reset, it leaves the existing context in place.

Reasoning

Subagents must be reconciled at the same boundary as parent context changes or children from an abandoned branch can remain active or later reappear. Running extension cancellation and optional summarization first avoids disturbing children for a navigation that will not commit. Quiesce and reset-barrier failures are fail-closed, while cleanup failures after a committed barrier are reported as warnings because the old roster has already been durably masked.

Changes

  • Reconciled the controller roster with the newly selected branch after successful tree navigation.
  • Quiesced active children immediately before leaf mutation and restored the previous leaf when quiescing or navigation failed.
  • Routed reload, manual harness selection, and prompt-boundary harness refresh through one reset path with a durable empty-roster barrier.
  • Delayed manual harness selection until the reset boundary succeeds and treated post-barrier cleanup failures as runtime warnings.
  • Preserved corrupt-newest snapshot masking and best-effort status writes during navigation.
  • Added controller and persistence regressions for navigation ordering, summarization, quiesce failure, reset failure, cleanup failure, and shared harness activation.

Testing

  • node ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-persistence.test.ts test/suite/subagent-services.test.ts test/suite/subagent-registration.test.ts test/suite/agent-session-harness-version.test.ts test/session-manager/fork-branch.test.ts test/session-selector-path-delete.test.ts
  • npm run check

@Issacboy123 Issacboy123 added enhancement New feature or request coding-agent labels Aug 25, 2026
@Issacboy123 Issacboy123 self-assigned this Aug 25, 2026
@Pepps233
Pepps233 force-pushed the feat/reconcile-persistent-subagents branch from bf05727 to 891437e Compare August 25, 2026 14:36
@Pepps233
Pepps233 self-requested a review August 25, 2026 16:13
@Issacboy123
Issacboy123 force-pushed the feat/reconcile-persistent-subagents branch from 891437e to f4e9f76 Compare August 27, 2026 10:54
@Issacboy123
Issacboy123 force-pushed the feat/reconcile-persistent-subagents branch from f4e9f76 to a4ff225 Compare August 27, 2026 23:11
@Issacboy123
Issacboy123 merged commit 76658da into main Aug 28, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding-agent enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants