WebSearch built-in tool returns an empty result envelope inside subagents (2.1.177)
Summary
When the built-in WebSearch tool is invoked from inside a subagent (Task/Agent), it consistently returns an empty result envelope — the query is echoed back but zero sources are attached:
Web search results for query: "<query>"
REMINDER: include sources in your response
The same tool works normally in the top-level session. This is not the permission-denied case in #46250 — there is no denial message; the call "succeeds" with no results.
Environment
- Claude Code 2.1.177 (Linux / WSL2)
- Reproduces on a subagent pinned to native
claude-haiku-4-5-20251001(so it is not a third-party router/proxy stripping the server tool).
Repro
- Define a subagent with
tools: [WebSearch]. - From the main session, dispatch it with any query needing live results (e.g. "current weather in London").
- Observe the returned
tool_result: query echoed, noweb_search_tool_resultblocks, zero sources.
Ground truth
Calling the Anthropic web_search server tool directly (same account/credentials, same machine) for the identical query returns 10 real results — so the entitlement and network path are fine. The empty envelope is produced by Claude Code's own WebSearch wrapper in the subagent path: it issues the nested request but the web_search server tool is never actually force-invoked, so the model hands back a tool-call intent instead of executed results.
Related
- Appears to match the observation in OmniRoute/issues#1882 (internal
web_search_20250305returns a function tool_call instead of results → empty array). - Distinct from #46250 (permission denial).