anthropics / anthropics/claude-code
[Bug] Anthropic API Error: Missing corresponding server_tool_use block for advisor_tool_result
- Lenguaje dominante
- Python
- Estrellas
- 145k
- Forks
- 23.1k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
**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"}]
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- api
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100