tool_use ids were found without tool_result` blocks #3146

Closed
opened 2026-02-16 17:38:51 -05:00 by yindo · 4 comments
Owner

Originally created by @berenddeboer on GitHub (Nov 26, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

With Anthropic Claude Opus 4.5 (latest)

Seems unrecoverable:

messages.55: `tool_use` ids were found without `tool_result` blocks immediately after:
toolu_01JKfqxRrU8oAPSczPHTGAkZ. Each `tool_use` block must have a corresponding
`tool_result` block in the next message.

Does not want to proceed after this.

OpenCode version

1.0.115

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04

Terminal

Alacritty, tmux

Originally created by @berenddeboer on GitHub (Nov 26, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description With Anthropic Claude Opus 4.5 (latest) Seems unrecoverable: ``` messages.55: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01JKfqxRrU8oAPSczPHTGAkZ. Each `tool_use` block must have a corresponding `tool_result` block in the next message. ``` Does not want to proceed after this. ### OpenCode version 1.0.115 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Ubuntu 24.04 ### Terminal Alacritty, tmux
yindo added the opentuibug labels 2026-02-16 17:38:51 -05:00
yindo closed this issue 2026-02-16 17:38:51 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 26, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2720: AI_APICallError: tool_use blocks found without corresponding tool_result blocks
  • #1662: AI_APICallError: tool_use ids were found without tool_result blocks immediately after (Claude Pro - Sonnet 4)
  • #2214: AI_APICallError: messages.3: tool_use ids were found without tool_result blocks immediately after (occurs when interrupting response mid-flight in plan mode)

These all report the same error about tool_use blocks not having corresponding tool_result blocks. The issue appears to be a known bug with the messaging format/validation when using Claude models.

Feel free to ignore if this relates to a specific new trigger or different use case with Claude Opus 4.5.

@github-actions[bot] commented on GitHub (Nov 26, 2025): This issue might be a duplicate of existing issues. Please check: - #2720: AI_APICallError: tool_use blocks found without corresponding tool_result blocks - #1662: AI_APICallError: `tool_use` ids were found without `tool_result` blocks immediately after (Claude Pro - Sonnet 4) - #2214: AI_APICallError: messages.3: `tool_use` ids were found without `tool_result` blocks immediately after (occurs when interrupting response mid-flight in plan mode) These all report the same error about tool_use blocks not having corresponding tool_result blocks. The issue appears to be a known bug with the messaging format/validation when using Claude models. Feel free to ignore if this relates to a specific new trigger or different use case with Claude Opus 4.5.
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

okay enoughs enough ill fix this

The anthropic api has some bug where it corrupts the local state, the client has to account for the discrepency itself

Until it's fixed you can always do /undo

@rekram1-node commented on GitHub (Nov 26, 2025): okay enoughs enough ill fix this The anthropic api has some bug where it corrupts the local state, the client has to account for the discrepency itself Until it's fixed you can always do /undo
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

im gonna close this as a duplicate but just know this is top of mind to address soon

@rekram1-node commented on GitHub (Nov 26, 2025): im gonna close this as a duplicate but just know this is top of mind to address soon
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

@berenddeboer any chance you can send me the file session.json from an export dump:

opencode export > session.json

Itll open up a selector if you can choose the session that errored for u

@rekram1-node commented on GitHub (Nov 26, 2025): @berenddeboer any chance you can send me the file session.json from an export dump: `opencode export > session.json` Itll open up a selector if you can choose the session that errored for u
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3146