anthropics / anthropics/claude-code

[Bug] Anthropic API Error: Missing corresponding server_tool_use block for advisor_tool_result

Aperta
#92,611 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area:core bug platform:macos
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

**Bug Description**
⏺ Switched to Opus 5 because Opus 5 (1M context) returned an error that could not be retried (400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.9.content.0: unexpected `tool_use_id` found in `advisor_tool_result` blocks:
srvtoolu_01UxG3e3F3MNKzeHtcyc5vV3. Each `advisor_tool_result` block must have a corresponding `server_tool_use` block before it."},"request_id"…)

⏺ API Error: 400 messages.9.content.0: unexpected `tool_use_id` found in `advisor_tool_result` blocks: srvtoolu_01UxG3e3F3MNKzeHtcyc5vV3. Each `advisor_tool_result` block must
have a corresponding `server_tool_use` block before it.

**Environment Info**
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.263
- Feedback ID: 7d2ce593-1194-4622-a41c-4ec2ebfd9304

**Errors**
```json
[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.9.content.0: unexpected `tool_use_id` found in `advisor_tool_result` blocks: srvtoolu_01UxG3e3F3MNKzeHtcyc5vV3. Each `advisor_tool_result` block must have a corresponding `server_tool_use` block before it.\"},\"request_id\":\"req_011CeohYYHXheDvjfrWHXUUX\"}\n at generate (/$bunfs/root/chunk-h4f48kbj.js:11:14239)\n at makeRequest (/$bunfs/root/chunk-h4f48kbj.js:51:8033)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-09-07T07:39:58.558Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.9.content.0: unexpected `tool_use_id` found in `advisor_tool_result` blocks: srvtoolu_01UxG3e3F3MNKzeHtcyc5vV3. Each `advisor_tool_result` block must have a corresponding `server_tool_use` block before it.\"},\"request_id\":\"req_011CeohZj4hqMfLoVQVMEwKc\"}\n at generate (/$bunfs/root/chunk-h4f48kbj.js:11:14239)\n at makeRequest (/$bunfs/root/chunk-h4f48kbj.js:51:8033)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-09-07T07:40:14.621Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.9.content.0: unexpected `tool_use_id` found in `advisor_tool_result` blocks: srvtoolu_01UxG3e3F3MNKzeHtcyc5vV3. Each `advisor_tool_result` block must have a corresponding `server_tool_use` block before it.\"},\"request_id\":\"req_011CeohbBCr51b417U9utLqW\"}\n at generate (/$bunfs/root/chunk-h4f48kbj.js:11:14239)\n at makeRequest (/$bunfs/root/chunk-h4f48kbj.js:51:8033)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-09-07T07:40:34.316Z"}]
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

The failure is reported from generate and makeRequest in /$bunfs/root/chunk-h4f48kbj.js and occurs in an Anthropic request using Opus 5. Start by reproducing the 400 with the supplied error text, then trace how advisor_tool_result and server_tool_use blocks are assembled. Done means the request is accepted without the missing-corresponding-block error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.