Tool use id bug
Description
I uploaded 2 images and a short message, got hit with this error.
OpenCode version
1.0.167
Steps to reproduce
- Upload 2 images with ctrl + v
- Add a short message
- Click enter
Screenshot and/or share link
Operating System
macOS 26.2
Terminal
Ghostty
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_useids were found withouttool_resultblocks immediately after - #1279: AI_APICallError: messages.1.content.2:
tool_useids must be unique - #1150: AI_APICallError:
tool_useids must be unique - #4077: In Memory Image can't be Pasted in Opencode After TUI Upgrade (image-related issues)
- #5101: Switching from an image supported model to a non-image model breaks the thread (image handling)
Feel free to ignore if none of these address your specific case.
ill look into it
How do I replicate?
I saw ur description but I think this prolly has to do w/ ordering and whatnot
If u could export session: opencode export > session.json it'd be amazing
https://gist.github.com/deriegle/db117ea51f6f55e814e855541bcd47ee
I ran into this too. I had a longer session and was on the main branch in my repo. I had a few files staged and ran /rmslop (same as in opencode) and ran into this bug. I opened a new session and ran /rmslop and got the error again. The gist above is from the second session.
EDIT: realizing the way mine happened was different (no images uploaded) but the error was similar in case that's helpful. Otherwise we can mark this as unrelated.
@deriegle can u give me the raw json export tho? opencode export > session.json
Sorry about that. I've added the session.json into this gist: https://gist.github.com/deriegle/db117ea51f6f55e814e855541bcd47ee
Several of the calls outputted my entire files since it was diffing them, I obfuscated the file names & outputs. If those end up being required to debug this, I can find another way to share that.
https://gist.github.com/Mishkun/02648359700010e559f7edf6bc8ac4dd
@rekram1-node I finally got this on a pet project, so I can share one in the full