Skip to content

Add tool search to Copilot agent host#326213

Draft
bhavyaus wants to merge 1 commit into
mainfrom
dev/bhavyau/agent-host-tool-search
Draft

Add tool search to Copilot agent host#326213
bhavyaus wants to merge 1 commit into
mainfrom
dev/bhavyau/agent-host-tool-search

Conversation

@bhavyaus

Copy link
Copy Markdown
Collaborator

Adds deferred tool search support to the Copilot agent host using the existing client-side semantic search.

Draft until VS Code bumps to @github/copilot-sdk@1.0.7 and @github/copilot@1.0.71.

Copilot AI review requested due to automatic review settings July 16, 2026 19:44

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.

Pull request overview

Adds experimental deferred tool search to Copilot Agent Host, delegating semantic ranking to the Copilot extension. Dependency bumps remain pending.

Changes:

  • Adds configuration, capability gating, prompt guidance, and SDK tool deferral.
  • Bridges deferred tool metadata to client-side semantic search.
  • Adds unit coverage for routing, metadata, models, and embeddings.
Show a summary per file
File Description
agentHostCopilotCliSettingsContribution.test.ts Tests setting forwarding.
chat.shared.contribution.ts Registers the experimental setting.
agentHostSessionHandler.ts Routes search calls to the client.
agentHostCopilotCliSettingsContribution.ts Forwards tool-search configuration.
toolSearchDeferral.test.ts Tests capability gating and constants.
copilotAgentSession.test.ts Tests deferred-tool routing.
agentHostPromptRegistry.test.ts Updates prompt test context.
agentMetaReaders.test.ts Tests candidate metadata validation.
toolSearchDeferral.ts Defines model support and exemptions.
toolInstructions.ts Adds tool-search prompt guidance.
promptRegistry.ts Applies guidance when search is active.
AGENTS.md Documents deferred loading architecture.
copilotSessionLauncher.ts Enables SDK tool search.
copilotAgentSession.ts Implements the client search override.
toolSearchConstants.ts Defines runtime/client tool names.
agentToolCallMeta.ts Adds candidate metadata handling.
copilotCliConfig.ts Defines root configuration.
toolSearchTool.ts Searches an injected Agent Host corpus.
toolSearchTool.spec.ts Tests injected and registry corpora.
toolEmbeddingsComputer.ts Supports uncached dynamic embeddings.

Review details

  • Files reviewed: 20/20 changed files
  • Comments generated: 3
  • Review effort level: Medium
Comment on lines +559 to +561
const toolSearchActive = this._configurationService.getRootValue(copilotCliConfigSchema, CopilotCliConfigKey.ToolSearchEnabled) === true
&& agentHostModelSupportsToolSearch(model?.id)
&& clientToolNames.has(CLIENT_TOOL_SEARCH_REFERENCE_NAME);
invocationMessage: getInvocationMessage(tracked.toolName, tracked.displayName, tracked.parameters),
toolInput: getToolInputString(tracked.toolName, tracked.parameters, tracked.parameters ? tryStringify(tracked.parameters) : undefined),
confirmed: ToolCallConfirmationReason.NotNeeded,
_meta: toToolCallMeta({ ...(tracked.meta ?? {}), toolSearchCandidates: candidates }),
Comment on lines +75 to +76
export function toolSearchInstructionLines(toolSearchActive: boolean): readonly ToolInstructionLine[] {
return toolSearchActive ? [...TOOL_INSTRUCTION_LINES, toolSearchToolInstructions] : TOOL_INSTRUCTION_LINES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants