Skip to content

agentHost: unblock disconnected client tool calls - #326049

Merged
Connor Peet (connor4312) merged 1 commit into
mainfrom
connor/fix-client-tool-disconnect-race
Jul 15, 2026
Merged

Connor Peet (connor4312) merged 1 commit into
mainfrom
connor/fix-client-tool-disconnect-race

Conversation

@connor4312

Copy link
Copy Markdown
Member

Summary

  • unblock Copilot client-tool permission requests when a disconnect result arrives first
  • suppress stale tool-ready actions after terminal completion
  • add unit and real Copilot Agent Host replay coverage for the race

Validation

  • npm run typecheck-client
  • full CopilotAgentSession unit suite (184 passing)
  • AgentSideEffects and PendingRequestRegistry unit suites
  • Copilot Agent Host E2E record and strict replay
  • npm run valid-layers-check
  • hygiene checks

Handle client-tool failures that arrive before Copilot registers its permission request, and suppress stale ready actions after terminal completion. Add unit and real Copilot replay coverage for the disconnect race.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 15, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prevents Copilot client-tool turns from hanging when disconnect completion races ahead of permission handling.

Changes:

  • Auto-approves already-completed client-tool permission requests.
  • Drops stale tool-ready actions after completion.
  • Adds unit and replay-based E2E race coverage.
Show a summary per file
File Description
src/vs/platform/agentHost/common/pendingRequestRegistry.ts Exposes buffered-result detection.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Unblocks permission requests with buffered results.
src/vs/platform/agentHost/node/agentSideEffects.ts Suppresses stale ready actions.
src/vs/platform/agentHost/test/common/pendingRequestRegistry.test.ts Tests buffered-result state.
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts Tests completion-before-permission behavior.
src/vs/platform/agentHost/test/node/agentSideEffects.test.ts Tests stale-ready suppression.
src/vs/platform/agentHost/test/node/protocol/copilotAgentHostE2E.integrationTest.ts Adds real host race coverage.
src/vs/platform/agentHost/test/node/protocol/captures/agentHostE2E/copilotcli-client-tool-disconnect-before-permission-still-completes-the-turn.yaml Records deterministic model traffic.

Review details

  • Files reviewed: 8/8 changed files
  • Comments generated: 0
  • Review effort level: Medium

@connor4312
Connor Peet (connor4312) merged commit cf790c0 into main Jul 15, 2026
47 of 48 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor/fix-client-tool-disconnect-race branch July 15, 2026 22:18
@vs-code-engineering vs-code-engineering Bot added this to the 1.130.0 milestone Jul 15, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants