anthropics / anthropics/claude-code
[Bug] Anthropic API Error: Missing corresponding server_tool_use block for advisor_tool_result
- Langage dominant
- Python
- Étoiles
- 145k
- Forks
- 23.1k
- Métriques de merge des PR
- Métriques de PR en attente
Description
**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"}]
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- api
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- À clarifier
- Accessibilité débutants
- 30/100