Skip to content

Each tool_use block must have a corresponding tool_result block in the next message. #212

@jeroenev

Description

@jeroenev

Description

I'm getting this error every time I send a message after compacting in OpenCode, only with anthropic models:

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

Steps to reproduce

  1. Open Thread in opencode
  2. use /compact
  3. Send new message

Operating system

Linux (Ubuntu 24.04)

Plugin version

1.5.0

OpenCode version

1.14.28

Debug logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions