[BUG] Server-side web_search blocks from an LLM gateway are never rendered — no "Web Search" line, and citation-segmented answers fragment into one bullet per block

Status Open
Reported on v2.1.206
Maintainer reply None cached
Activity 0 comments · opened Jul 16, 2026

Preflight

  • Searched existing issues for gateway + web search rendering; found reports about WebSearch being unavailable behind gateways (e.g. #7806), but none about received server_tool_use/web_search_tool_result blocks not rendering.
  • Reproduced on Claude Code 2.1.206, 2.1.210, and 2.1.211 (identical behavior on all three — this is longstanding, not a recent regression). Linux, gateway sign-in (Anthropic Messages format).

Setup

Claude Code is connected to a self-hosted LLM gateway (Anthropic Messages format, per the gateway protocol reference). Because Claude Code hides its built-in WebSearch tool behind gateways, the gateway adds the server tool to requests for search-capable models:

{"type": "web_search_20250305", "name": "web_search", "max_uses": 5}

The upstream is Claude; the gateway relays the response stream byte-for-byte.

What happens

The model searches (the API bills it: usage.server_tool_use.web_search_requests > 0, and answers contain fresh post-training facts with sources), and the stream carries the standard native block sequence — but Claude Code renders no "⏺ Web Search" indicator at all. The search is invisible to the user. Other API clients rendering the same stream do show the search activity.

Captured wire for one such turn (curl through the gateway, claude-sonnet-4-6, streaming):

event sequence:  message_start, content_block_start×9, content_block_delta×106,
                 content_block_stop×9, message_delta, message_stop, ping
content_block order:
  [0] server_tool_use          (name=web_search)
  [1] web_search_tool_result   (10 × web_search_result, each with encrypted_content)
  [2..8] text                  (3× citations_delta / web_search_result_location)
stop_reason: end_turn

i.e. native search-first ordering with encrypted_content and citations — indistinguishable from an api.anthropic.com response.

Second symptom, same feature area

The citation-segmented answer (multiple text blocks, one per cited span) renders as one bullet per content block, so numbered lists fragment — a block containing just 2. renders as its own bullet line:

● In a microwave-safe bowl, toss the apple with brown sugar…
● 2.
● In a separate bowl, mix two teaspoons of cornstarch…

Clients that merge a message's text blocks show one cohesive body. Also reproduced on 2.1.206.

Repro

  1. Point Claude Code at any Anthropic-format gateway (ANTHROPIC_BASE_URL or gateway sign-in) that adds the web_search_20250305 tool to /v1/messages requests and relays Claude's response verbatim.
  2. Ask for something requiring a search ("web search for the latest Terraform release and cite the URL").
  3. Confirm the search ran (usage counters / grounded answer). Observe: no Web Search line; fragmented bullets.

Expected

Render the Web Search activity line for server_tool_use/web_search_tool_result blocks received over a gateway (as when connected to api.anthropic.com directly), and merge consecutive text blocks of one message when displaying — or document that server-tool rendering is unsupported over gateways.

View original on GitHub ↗