[BUG] CLAUDE_CODE_EXTRA_BODY thinking field is merged into WebSearch/WebFetch requests and breaks them (still on 2.1.290; follow-up to #56984)
What's wrong
CLAUDE_CODE_EXTRA_BODY is merged into the internal requests that WebSearch and WebFetch make, so any thinking field set there breaks both tools. This is the bug in #56984, which the inactivity bot closed as not planned; the bot asked for a new issue if it is still relevant. It still reproduces on 2.1.290 with a Claude 5 model, and the third condition below shows how the field reaches those requests.
The variable is a common workaround for getting thinking summaries where showThinkingSummaries has no effect; anyone relying on that workaround loses web search.
Measured (same machine, same session, relaunched between conditions; the variable read from the running claude process's own environment each time)
| CLAUDE_CODE_EXTRA_BODY | Main model | WebSearch and WebFetch |
|---|---|---|
| {"thinking":{"type":"adaptive","display":"summarized"}} | works | API Error: 400 adaptive thinking is not supported on this model |
| unset | works | work |
| {"thinking":{"display":"summarized"}} | works | API Error: 400 thinking.type: Field required |
The error text follows whatever thinking value the variable holds, so the extra body is being merged into the web tools' secondary requests. Only these two tools failed; other tools in the same sessions worked.
What should happen
Apply CLAUDE_CODE_EXTRA_BODY only to the main conversation requests, or strip fields (like thinking) that the web tools' internal requests cannot accept. Either way, a user should be able to have thinking summaries and web search at the same time.
Steps to reproduce
- Launch Claude Code with
CLAUDE_CODE_EXTRA_BODY='{"thinking":{"type":"adaptive","display":"summarized"}}'in the environment. - Ask for any web search, or a fetch of any URL.
- Both fail with
400 adaptive thinking is not supported on this model. - Relaunch with
CLAUDE_CODE_EXTRA_BODY='{"thinking":{"display":"summarized"}}'and repeat: both fail with400 thinking.type: Field required. - Relaunch without the variable: both work.
Environment
- Claude Code 2.1.290
- Model: claude-opus-5-5
- Platform: Linux (WSL2)
- Also reported through
/feedback(receipts15276811-0c0e-4438-ab5e-a41c7004a8a6,43e197dd-5779-4255-b226-f286620e052c)
Related
- #56984 (same bug, closed by the inactivity bot)
- #95497 and #89633 (same
adaptive thinking is not supportederror from WebFetch/WebSearch; they don't say whether this variable was set, so they may or may not share this cause)