Repository navigation
agentHost: unblock disconnected client tool calls - #326049
Merged
Connor Peet (connor4312) merged 1 commit intoJul 15, 2026
Merged
Conversation
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]>
Contributor
There was a problem hiding this comment.
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
roblourens
approved these changes
Jul 15, 2026
Connor Peet (connor4312)
deleted the
connor/fix-client-tool-disconnect-race
branch
July 15, 2026 22:18
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Validation