Repository navigation
Claude agent host: keep WebSearch available on the native transport - #337887
Roman Rokon (romanrokon) wants to merge 2 commits into
Conversation
The WebSearch block exists because CAPI does not support the tool, which only applies when the SDK is routed through the Copilot proxy. Native (Anthropic-auth) sessions talk to Anthropic directly, where WebSearch works, so only disallow it for the proxy transport. Fixes microsoft#337886
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: TylerLeonhardtMatched files:
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The behavior matches the transport capabilities and has focused regression coverage; the remaining comment-style issue is non-blocking.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Scopes Claude WebSearch blocking to Copilot-proxy sessions while preserving it for native Anthropic sessions.
Changes:
- Applies
disallowedToolsonly to proxy transport. - Adds proxy/native regression tests.
- Updates roadmap documentation.
| File | Description |
|---|---|
claudeSdkOptions.ts |
Makes WebSearch blocking transport-specific. |
claudeSdkOptions.test.ts |
Tests proxy and native behavior. |
roadmap.md |
Documents the transport distinction. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // CAPI (the Copilot proxy) doesn't support the WebSearch tool, so it is | ||
| // disabled there. Native sessions talk to Anthropic directly, where it works. |
There was a problem hiding this comment.
Condensed to one line in 82f1ebc.
|
@microsoft-github-policy-service agree |
|
TylerLeonhardt since you wrote the native transport (#323037): the WebSearch block's documented reason in |
|
TylerLeonhardt friendly ping. This is a one-line change in I also checked it at runtime: with SDK 0.3.281 on native subscription auth and |

Fixes #337886
What
buildOptionspasseddisallowedTools: ['WebSearch']for every Claude session. The reason, perroadmap.md, is that CAPI doesn't support WebSearch, which only applies when the SDK is routed through the Copilot proxy. Native (Anthropic-auth) sessions talk to Anthropic directly, where WebSearch works, so they were losing web search for no reason.The block now applies only when
transport.kind === 'proxy', using theisProxyflagbuildOptionsalready computes for the other transport-specific options. The two roadmap lines describing the setting are updated to match.How to test
claudeSdkOptions.test.ts: the proxy transport still setsdisallowedTools: ['WebSearch']; the native transport leaves it unset.CLAUDE_CODE_OAUTH_TOKENorANTHROPIC_API_KEY, ask for a web search. Before the change the model has no WebSearch tool; after it, the search runs and returns results. Copilot-routed sessions are unchanged.I tested the native behaviour by applying the same change to the built 1.139.0
agentHostMain.js; I haven't run the unit tests locally.🤖 Generated with Claude Code
https://claude.ai/code/session_015wqjvswfjKqx3aDMsuMiBG