Skip to content

agentHost: run tool search on the host when its owner is disconnected - #346713

Merged
Bhavya U (bhavyaus) merged 2 commits into
mainfrom
bhavyaus/tool-search-host-fallback-disconnected
Nov 7, 2026
Merged

Bhavya U (bhavyaus) merged 2 commits into
mainfrom
bhavyaus/tool-search-host-fallback-disconnected

Conversation

@bhavyaus

@bhavyaus Bhavya U (bhavyaus) commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

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_tool call 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_message aren't found while no client is connected. Those tools couldn't run without a connected client anyway.

Bhavya U (bhavyaus) and others added 2 commits November 6, 2026 17:38
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]>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 01:56
@bhavyaus
Bhavya U (bhavyaus) enabled auto-merge (squash) November 7, 2026 01:58

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.

🟢 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

@bhavyaus
Bhavya U (bhavyaus) merged commit 1745a4a into main Nov 7, 2026
53 checks passed
@bhavyaus
Bhavya U (bhavyaus) deleted the bhavyaus/tool-search-host-fallback-disconnected branch November 7, 2026 02:05
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants