Repository navigation
agentHost: don't route client tools of a moved chat to clients of its old session - #346718
Merged
Merged
Conversation
… old session After a running chat moved to another session, the destination's active-client state did not know the chat yet, and unknown chats are treated as reachable by every client. Client tool calls in the moved chat were therefore still assigned to a window that never subscribed to the destination session, so the call waited until that window opened the moved chat. For a moved chat, only admit clients the destination has published membership for, and pick candidates from the destination's tool set. Until a window joins the destination, tool search runs on the host and other client tools fail immediately instead of hanging. Fixes #346456 Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The moved-chat routing change lacks regression coverage for fallback and failure before destination membership is published, followed by routing exclusively to destination clients advertising the requested tool.
1 open issue
What changed in this PR
This PR addresses client-tool stalls after a live chat moves between Agent Host sessions by selecting tool owners from the destination rather than the launch session.
Changes:
- Reads client candidates and tool definitions from the destination session’s registry.
- Requires published destination membership before routing moved-chat tools, allowing host search fallback or immediate failure when no client qualifies.
- Preserves routing behavior for chats that have not moved.
| File | Description |
|---|---|
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Adds a dynamic tool-registry callback used during client-tool owner selection. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Resolves the current owner’s registry and enforces destination membership for moved chats. |
Review effort: Balanced
Co-authored-by: Copilot <[email protected]>
Vijay Upadya (vijayupadya)
approved these changes
Nov 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.

Fixes #346456
When a running chat is moved to another session (for example with
move_session), its runtime keeps picking client tool owners from the session it launched in. The destination session's active-client state doesn't know the moved chat yet, and unknown chats are treated as reachable by every client, so client tool calls in the moved chat were still assigned to a window that never subscribed to the destination session. That window only sees the request once it opens the moved chat, so the turn stalls on "Running Search tools on another client…".For a moved chat (current owner differs from the launch owner):
Until a window joins the destination, tool search runs on the host (#346713) and other client tools fail immediately instead of hanging. Once a window opens the moved chat, client tools route to it as before. Chats that never moved are unchanged.