Repository navigation
Fix restored private subagent catalog admission - #340284
Merged
Merged
Conversation
Co-authored-by: Copilot <[email protected]>
Stage historical private chats when normalized catalog authority activates, preserve existing catalog membership and dirty revisions, and retry transient restore admission before inherited workspace metadata is updated. Co-authored-by: Copilot <[email protected]>
Rebuild staged historical chat membership under the catalog migration lock and cancel retained admission retries when their owning session incarnation is removed. Co-authored-by: Copilot <[email protected]>
Carry restored-session lifetime validation through queued private metadata hydration, catalog synchronization, and transactional normalized writes so an evicted owner cannot persist stale historical children into a same-URI reload. Co-authored-by: Copilot <[email protected]>
Validate restored-admission lifetimes inside central and local SQLite transactions so owner reloads roll back private chat and pending catalog receipt writes before commit. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
marked this pull request as ready for review
October 7, 2026 13:46
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
October 7, 2026 13:46
Sandeep Somavarapu (sandy081)
disabled auto-merge
October 7, 2026 13:47
Preserve upstream normalized-peer legacy projection while keeping restored-admission lifetime validation as the final pre-commit transaction boundary. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The multi-database transactional and session-lifetime concurrency changes warrant final human review.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes durable catalog admission for restored private subagents while fencing stale writes across session incarnations.
Changes:
- Persists restored subagents with hidden lineage and legacy-catalog reconciliation.
- Adds transaction-boundary lifetime validation and cancellation outcomes.
- Adds regression coverage for retries, reloads, and rollback behavior.
| File | Description |
|---|---|
common/sessionDataService.ts |
Adds cancellable catalog-write contracts. |
node/agentService.ts |
Implements restored-subagent admission and retries. |
node/agentHostCatalogSyncService.ts |
Propagates write validators through synchronization. |
node/agentHostChatCatalogMigration.ts |
Fences catalog migration writes. |
node/agentHostDatabase.ts |
Rolls back stale central database transactions. |
node/sessionDatabase.ts |
Rolls back stale per-session transactions. |
node/agentHostPeerChatStore.ts |
Supports cancellable private-chat persistence. |
test/common/sessionTestHelpers.ts |
Updates test database contracts. |
test/node/agentService.test.ts |
Covers admission, retries, and reload races. |
test/node/agentHostCatalogSyncService.test.ts |
Updates synchronization test doubles. |
test/node/sessionArtifactRemoval.test.ts |
Forwards validators in test databases. |
test/node/sessionDatabase.test.ts |
Updates transition-result assertions. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Cancel restored catalog activation when the owning session is reloaded while normalized peers are projected to the legacy mirror. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
October 7, 2026 13:59
Sandeep Somavarapu (sandy081)
disabled auto-merge
October 7, 2026 14:00
Contributor
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
October 7, 2026 14:05
Capture list-visible state before entering the deferred synchronization queue so shutdown and adoption cleanup cannot invalidate an already-requested catalog write. Keep restored migration requests deriving their source under the migration lock. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
disabled auto-merge
October 7, 2026 14:15
Carry immutable session snapshots through queued, coalesced, and ordered catalog writes so residency eviction cannot drop a requested mutation. Keep restored migration source resolution inside its migration lock. Co-authored-by: Copilot <[email protected]>
Install ordered catalog writes as request-time barriers in the existing per-session queue. Later coalesced state snapshots now replay after the ordered mutation while eviction-safe snapshots and background error isolation remain intact. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
enabled auto-merge
October 7, 2026 14:41
Sandeep Somavarapu (sandy081)
disabled auto-merge
October 7, 2026 14:41
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
October 7, 2026 14:41
Sandeep Somavarapu (sandy081)
disabled auto-merge
October 7, 2026 14:42
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
October 7, 2026 15:16
roblourens
approved these changes
Oct 7, 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
Fix restored historical private subagents being materialized in memory without durable normalized catalog membership, which caused later metadata updates such as workspace pinning to fail with
Missing normalized chat.The repair:
This does not change AHP protocol behavior, add readiness behavior, repair live profile databases, or import the separate move/foundation work.
Validation
./scripts/test.sh --run src/vs/platform/agentHost/test/node/agentService.test.ts --grep 'catalog revision update|local receipt commit'— 0 passing, 2 failing, reproducing the stale child/header commit and stale local receipt commit../scripts/test.sh --reporter dot --run src/vs/platform/agentHost/test/node/agentHostDatabase.test.ts --run src/vs/platform/agentHost/test/node/sessionDatabase.test.ts --run src/vs/platform/agentHost/test/node/agentHostCatalogSyncService.test.ts --run src/vs/platform/agentHost/test/node/agentHostPeerChatStore.test.ts --run src/vs/platform/agentHost/test/node/sessionArtifactRemoval.test.ts— 312 passing../scripts/test.sh --reporter dot --run src/vs/platform/agentHost/test/node/agentService.test.ts --grep 'restored subagent|historical subagent|legacy owner|catalog revision update|local receipt commit'— 13 passing.npm run build-fast -- --client-only— passed.npm run typecheck-client— passed.npm run eslint -- src/vs/platform/agentHost/common/sessionDataService.ts src/vs/platform/agentHost/node/agentHostCatalogSyncService.ts src/vs/platform/agentHost/node/agentHostDatabase.ts src/vs/platform/agentHost/node/sessionDatabase.ts src/vs/platform/agentHost/test/common/sessionTestHelpers.ts src/vs/platform/agentHost/test/node/agentHostCatalogSyncService.test.ts src/vs/platform/agentHost/test/node/agentService.test.ts src/vs/platform/agentHost/test/node/sessionArtifactRemoval.test.ts src/vs/platform/agentHost/test/node/sessionDatabase.test.ts— passed.git diff --check— passed.