Repository navigation
agentHost: run tool search on the host when its owner is disconnected - #346713
Merged
Bhavya U (bhavyaus) merged 2 commits intoNov 7, 2026
Merged
Conversation
When every client that provides tool search is only inside its disconnect grace, route tool search to the existing host-side search instead of waiting on the disconnected client. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change enabling immediate Agent Host fallback for runtime tool search when eligible clients are disconnected.
No open issues 🎉
What changed in this PR
This follow-up to #346681 lets runtime tool search fall back immediately to the Agent Host when all eligible clients are disconnected, rather than waiting through reconnect grace. Other client tools retain their existing routing behavior.
Changes:
- Allow owner resolution to return no client for host-runnable runtime tool search when no eligible client is connected.
- Update disconnect-grace test expectations to reflect host fallback while preserving client ownership after reconnection.
| File | Description |
|---|---|
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Updates tool-search ownership and readiness expectations during disconnect grace. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Enables host fallback specifically for active runtime tool search without changing MCP-app toolSearch routing. |
Review effort: Balanced
Raymond Zhao (rzhao271)
approved these changes
Nov 7, 2026
Ross Wollman (rwoll)
approved these changes
Nov 7, 2026
Bhavya U (bhavyaus)
deleted the
bhavyaus/tool-search-host-fallback-disconnected
branch
November 7, 2026 02:05
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.
Follow-up to #346681.
When every client that provides tool search is disconnected but still inside its disconnect grace, #346681 still assigns the runtime
tool_search_toolcall to one of those disconnected clients. The call then waits up to the detection plus grace deadline and fails.Tool search can run on the host (
_searchToolsOnHost), so this change returns no owner for the runtime tool search call in that case. The existing host fallback then runs immediately instead of waiting on a client that may not come back. Other client tools keep the current behaviour and stay on the disconnected client, since they need that client to run.Known limitation: the host search only covers host-runnable deferred tools, so client-provided tools such as
send_messagearen't found while no client is connected. Those tools couldn't run without a connected client anyway.