anthropics / anthropics/claude-code
[Bug] Anthropic API Error: Missing corresponding server_tool_use block for advisor_tool_result
- 主要言語
- Python
- スター
- 145k
- フォーク
- 23.1k
- PR マージ指標
- PR 指標を取得中
説明
**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"}]
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100