anthropics / anthropics/claude-code

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

Offen
#92,611 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:core bug platform:macos
Vorherrschende Sprache
Python
Sterne
145k
Forks
23.1k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

**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"}]
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
api
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.