Fix multiple askQuestions in Agent Host#323943
Draft
jruales wants to merge 1 commit into
Draft
Conversation
jruales
commented
Jul 1, 2026
Contributor
- Fixes Browser: Chat shows multiple stacked askQuestions requests to share existing browser tabs #323777
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an Agent Host lifecycle bug where client tool invocations (notably askQuestions-driven UI) could remain running after the protocol tool call was already in a terminal state, leading to multiple stacked question prompts (per #323777).
Changes:
- Treat
ToolCallStatus.Completedas a terminal protocol state (in addition toCancelled) for driving local cancellation of an in-flightinvokeTool. - Avoid forcing the local invocation into
Cancelledwhen the protocol state isCompleted, while still cancelling the local CTS to ensure cleanup can happen.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts | Cancels local client-tool execution when the protocol tool call reaches a terminal state to prevent orphaned UI (e.g. stacked askQuestions). |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
Comment on lines
+2352
to
+2360
| // The protocol tool call reached a terminal state. If this was | ||
| // driven by the server (e.g. the client-tool bridge abandoned the | ||
| // call because the client was considered disconnected, the turn was | ||
| // superseded, or a reconnect occurred) while our local `invokeTool` | ||
| // is still running, cancel it so the tool cleans up (e.g. dismisses a | ||
| // pending question carousel) instead of blocking forever on an answer | ||
| // nobody will consume. In the normal path we complete the call | ||
| // ourselves first, so `invokeTool` has already settled and this | ||
| // cancellation is a harmless no-op. |
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.