Skip to content

Claude agent host: native (Anthropic-auth) sessions have WebSearch disabled by the CAPI-only disallowedTools block #337886

Description

  • VS Code Version: 1.139.0
  • OS Version: macOS 27.0 (arm64)
  • Harness: Claude agent host, native Anthropic auth (CLAUDE_CODE_OAUTH_TOKEN)

Problem

buildOptions in src/vs/platform/agentHost/node/claude/claudeSdkOptions.ts always passes disallowedTools: ['WebSearch'] to the Claude Agent SDK, for both transports.

The reason is documented in src/vs/platform/agentHost/node/claude/roadmap.md: "CAPI does not yet support the WebSearch tool. Without this the SDK may invoke it and the upstream CAPI call will fail mid-session." That applies to the Copilot proxy transport. On the native transport the SDK talks to Anthropic directly, where WebSearch works, so native sessions lose web search for a reason that doesn't apply to them.

Evidence

  • In native Claude sessions before any change, the transcripts show zero web searches over a day of use; the model could only fetch URLs it already knew.
  • With the disallowedTools entry removed for native sessions, the model called WebSearch and received results normally.

Proposed fix

Keep the block for transport.kind === 'proxy' and omit it for 'native'. buildOptions already computes isProxy for the same kind of transport-specific setting (ANTHROPIC_BASE_URL, subprocess env). I'll open a PR with the change and tests.

Activity

  1. added a commit that references this issue on Sep 25, 2026
    4d50e97
  2. added
    claude-agent
    on Sep 25, 2026
  3. benji-farquhar commented on Oct 16, 2026

    @benji-farquhar

    Still reproduces on 1.142.0 with native Anthropic auth (CLAUDE_CODE_OAUTH_TOKEN): Claude sessions never call WebSearch, while the same account in the terminal does. I'm working around it with a self-hosted SearXNG MCP server, which works but is extra infrastructure. The approach in #337887 of keeping the block only for the proxy transport matches what I'd expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

claude-agent

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions