-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Description
When using the plugin, the Anthropic API rejects the request because tool_use blocks are sent without their corresponding tool_result blocks in the following message.
Error
messages.43: `tool_use` ids were found without `tool_result` blocks immediately after:
toolu_012Z2GoLgracmYWaur26knX3, toolu_015dY9D1V5UVaGBhtg4XP41s, toolu_018yzzDMbmqAQHaivCiYAyuJ.
Each `tool_use` block must have a corresponding `tool_result` block in the next message.
Expected Behavior
Every tool_use block in the conversation history should have a matching tool_result block in the immediately following message, per the Anthropic API contract.
Actual Behavior
Three tool_use IDs were present in the message history without their tool_result counterparts at messages.43, causing the API to reject the entire request.
Possible Causes
- Tool execution results being dropped/lost before being appended to conversation history
- Race condition when multiple tools execute in parallel — some results may not be collected before the next API call
- Session serialization/deserialization losing
tool_resultentries
Related
- Bug: Session corrupted when tool execution is aborted - missing tool_result causes API rejection #755 — similar issue but specific to aborted tool executions; this occurs during normal (non-aborted) operation
Environment
- Plugin: oh-my-opencode
- API: Anthropic (Claude)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels