anthropics / anthropics/claude-code

[BUG] WebSearch tool fails with "adaptive thinking is not supported on this model" (400)

Ouverte
#89,633 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
api:anthropic area:tools bug platform:macos
Langage dominant
Python
Étoiles
145k
Forks
23.1k
Métriques de merge des PR
Métriques de PR en attente

Description

### What's Wrong?

Every call to the `WebSearch` tool in this session fails with a 400 error:

```
API Error: 400 adaptive thinking is not supported on this model
```

Per the official troubleshooting doc (https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting#a-400-error-says-adaptive-thinking-is-not-supported), this specific error string means:

> This happens because the model supports only extended thinking ... Use `thinking: {type: "enabled", budget_tokens: N}` instead.

This is the mirror-image bug of #50100 (which was `"thinking.type.enabled" is not supported for this model` — client sending legacy `enabled` to an adaptive-only model). Here, the client appears to be sending `thinking: {type: "adaptive"}` on a request that's actually being served by an extended-thinking-only model, or by a provider/model combination that doesn't support adaptive thinking.

### What Should Happen?

Claude Code should pick the correct `thinking.type` (adaptive vs. extended/`enabled`+`budget_tokens`) for whichever model is actually handling the `WebSearch` tool call, so the tool works regardless of which chat model (`/model`) is selected.

### Steps to Reproduce

1. In an active Claude Code session, trigger the `WebSearch` tool (e.g. ask Claude to search the web for something).
2. Observe: `API Error: 400 adaptive thinking is not supported on this model`.
3. Switching the session's chat model (`/model opus`, `/model sonnet`) does **not** resolve it — error persists identically regardless of selected model, suggesting the WebSearch tool call itself is misconfigured or routed to a fixed backend model independent of the user's model selection.

### Additional Information

- Related/possibly-relevant prior reports: #50100 (opposite error, `thinking.type.enabled` rejected — Bedrock + `[1m]` context suffix), #43950 (WebSearch 400s with a different message, went stale/closed without fix)
- Root-cause diagnosis based on official docs: https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting

### Claude Code Version

Current (session-reported model: Claude Sonnet 5)

### Platform

Anthropic API (claude.ai / Claude Code session, non-Bedrock)

### Operating System

macOS (Darwin 25.5.0)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start by tracing the WebSearch tool request construction and the model-selection path, especially where the thinking configuration is chosen. Reproduce the 400 error with the reported model variations, then verify that WebSearch succeeds with the appropriate thinking mode for each supported backend or model combination.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
api, backend-api-design
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
38/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.