agentHost: Reconcile retained-child status after stale reads - #335979
Dmitriy Vasyura (dmitrivMS) wants to merge 3 commits into
Conversation
Capture task-status freshness when each RPC starts and drain invalidated reads through the existing single-flight scheduler. Guard completion application across resumption, cancellation and disposal, and add deterministic delayed-query regressions. Related to #335458; child execution identity remains a separate fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The scheduler changes are internally consistent and covered by targeted deterministic regressions.
Review tier: Balanced (auto)
Findings: None
Note
Copilot is running an experiment and ran this review at Balanced.
What changed in this PR
Fixes stale retained-subagent status reconciliation while improving related diagnostics and regression coverage.
Changes:
- Reconciles invalidated status reads serially until reaching a stable revision.
- Stops reconciliation after cancellation or disposal.
- Adds deterministic race/lifecycle tests and richer E2E failure details.
| File | Description |
|---|---|
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Implements revision-aware reconciliation. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Adds race, serialization, and lifecycle tests. |
src/vs/platform/agentHost/test/node/e2e/suites/subagentSuite.ts |
Expands retained-child diagnostics. |
src/vs/platform/agentHost/test/node/e2e/README.md |
Documents failure interpretation and coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Base:
|
Clear only the aborted root's active child ownership and usage through the existing silent completion cleanup before awaiting the SDK. Preserve stable routing and cancellation guards so late status replies cannot affect a reused child. Add abort/reuse accounting regressions and explicit initial/follow-up identities in retained-child fixtures. Keep the duplicate-child ledger and combined validation overlay out of this standalone change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The concurrency and cleanup changes are narrowly scoped and covered by comprehensive deterministic regressions.
Review tier: Balanced (auto)
Findings: None
Note
Copilot is running an experiment and ran this review at Balanced.
Pull request was converted to draft
Summary
Fix retained subagents staying active when a resume invalidates an in-flight task-status read.
Related to #335458. Duplicate-child execution identity is handled separately in #335989.
Validation
c77343648da0: 127 selected unit tests and 4 strict replays passed. Combined code is not included here.