Add tool search to Copilot agent host#326213
Draft
bhavyaus wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
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; |
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.
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.7and@github/copilot@1.0.71.