Skip to content

Agent Host: disable the Copilot runtime's semantic_code_search tool - #342126

Merged
Bhavya U (bhavyaus) merged 1 commit into
mainfrom
bhavyau/disable-runtime-semantic-code-search
Oct 16, 2026
Merged

Bhavya U (bhavyaus) merged 1 commit into
mainfrom
bhavyau/disable-runtime-semantic-code-search

Conversation

@bhavyaus

Copy link
Copy Markdown
Collaborator

The Copilot runtime now ships a built-in semantic_code_search tool (already present with SDK 1.0.23-preview.2 on main, and kept in the #342093 bump). Agent Host sessions already have our own semantic_search client tool, so this excludes the runtime one (builtin:semantic_code_search) to avoid offering the model two overlapping semantic search tools.

Per discussion with Timothy Clem (@tclem): clients with their own tools are expected to override these built-ins. The runtime tool is remote-only (no local chunking/embedding or external ingest), and the CLI is actively A/B testing its prompt variations and two deferred-loading strategies. We'll revisit — possibly with our own A/B experiment — in a future iteration. This rationale is captured in a comment next to the exclusion.

Changes:

  • copilotSessionLauncher.ts: always add builtin:semantic_code_search to the SDK excludedTools, with the note above.
  • copilotToolDisplay.ts: add CopilotToolName.SemanticCodeSearch.
  • Unit tests: update expected excludedTools.
  • E2E: regenerate the Copilot prompt snapshots (each loses only the semantic_code_search tool definition) and note the exclusion in the E2E README.

This is independent of the SDK bump in #342093, which will pick it up on its next merge from main.

How to test

  • ./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts: 888 passing, 14 failing. The same 14 CopilotAgent tests fail on main without this change; they're environment-related (they expect a /home/test/... session-state path).
  • AGENT_HOST_UPDATE_AHP_SNAPSHOTS=1 ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/e2e/providers/copilotPromptsE2E.integrationTest.ts to regenerate the prompt snapshots, then the same command without the variable (replay): 24 passing.
  • npm run eslint on the changed TypeScript files: clean.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 17:39
@bhavyaus
Bhavya U (bhavyaus) enabled auto-merge (squash) October 16, 2026 17:41
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Base: 46da08ea Current: 7c4679ce

No screenshot changes.

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

The narrowly scoped exclusion has consistent unit expectations and prompt baselines, with no unresolved actionable findings.

0 open findings

What changed in this PR

Disables Copilot’s built-in semantic_code_search in Agent Host sessions to avoid overlap with the existing semantic_search client tool, independently of the SDK bump.

Changes:

  • Adds the runtime tool identifier and unconditional exclusion.
  • Updates unit expectations and 19 prompt snapshots.
  • Documents the exclusion rationale.

Paths below are relative to src/vs/platform/agentHost/.

File Description
test/​node/​e2e/​README.md Documents the exclusion.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5-mini.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5-codex.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5_6-terra.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5_6-sol.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5_6-luna.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5_1.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gpt-5_1-codex-mini.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_gemini-2_0-flash.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-sonnet-5.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_6.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-sonnet-4_5.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-opus-5.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-opus-5_5.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-opus-4_7.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-opus-4_6.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-opus-4_5.prompt.md Removes the native tool definition.
test/​node/​e2e/​providers/​__snapshots__/​Agent_Host_E2E___Copilot_prompts_claude-haiku-4_5.prompt.md Removes the native tool definition.
test/​node/​copilotSessionLauncher.test.ts Updates excluded-tool expectations.
test/​node/​copilotAgent.test.ts Updates session configuration expectations.
node/​copilot/​copilotToolDisplay.ts Adds the native tool identifier.
node/​copilot/​copilotSessionLauncher.ts Excludes the tool and explains why.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Exclude the runtime's built-in `semantic_code_search` tool from Copilot SDK
sessions in favor of the Agent Host's own `semantic_search` client tool.
The runtime tool is remote-only (no local chunking/embedding or external
ingest) and the CLI is still A/B testing its prompt variations and
deferred-loading strategies; revisit in a future iteration.

Co-authored-by: Copilot <[email protected]>
@bhavyaus
Bhavya U (bhavyaus) force-pushed the bhavyau/disable-runtime-semantic-code-search branch from f6a80cc to 7acd5ac Compare October 16, 2026 19:02
@bhavyaus
Bhavya U (bhavyaus) merged commit 4e94103 into main Oct 16, 2026
49 checks passed
@bhavyaus
Bhavya U (bhavyaus) deleted the bhavyau/disable-runtime-semantic-code-search branch October 16, 2026 19:51
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 16, 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