AI_APICallError: messages.3: tool_use ids were found without tool_result blocks immediately after: toolu_01G5ipgNZWmDHuV6cvzyQpfH. Each tool_use block must have a corresponding tool_result block in the next message. #1464

Open
opened 2026-02-16 17:31:06 -05:00 by yindo · 2 comments
Owner

Originally created by @CestDiego on GitHub (Aug 23, 2025).

Originally assigned to: @thdxr on GitHub.

Recently been getting these kind of messages when i interrupt a response mid flight in plan mode.

Originally created by @CestDiego on GitHub (Aug 23, 2025). Originally assigned to: @thdxr on GitHub. Recently been getting these kind of messages when i interrupt a response mid flight in plan mode.
Author
Owner

@garrett-hopper commented on GitHub (Aug 25, 2025):

Image

Not much helpful context on why I received this unfortunately. Everything working fine prior. Claude Sonnet 4 model. Opencode v0.5.18

After it occurs, the session is borked going forward. New messages result in the same error. Restarting opencode and resuming the session doesn't change anything.

@garrett-hopper commented on GitHub (Aug 25, 2025): <img width="2454" height="148" alt="Image" src="https://github.com/user-attachments/assets/34060632-4a07-43ed-9b0a-4b0c06407f79" /> Not much helpful context on why I received this unfortunately. Everything working fine prior. Claude Sonnet 4 model. Opencode v0.5.18 After it occurs, the session is borked going forward. New messages result in the same error. Restarting opencode and resuming the session doesn't change anything.
Author
Owner

@garrett-hopper commented on GitHub (Aug 25, 2025):

It looks like /undo one message before the error started to occur does resolve the issue. (Though obviously losing the results of that message which was actually successful.)

@garrett-hopper commented on GitHub (Aug 25, 2025): It looks like `/undo` one message before the error started to occur does resolve the issue. (Though obviously losing the results of that message which was actually successful.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1464