You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: aborted bash tool call can leave a dangling tool_use without tool_result and corrupt the session #21489
An aborted tool call can leave the session in a malformed state where a previous tool_use no longer has a corresponding tool_result. After that, the whole session becomes unusable.
Observed error
messages.69: tool_use ids were found without tool_result blocks immediately after: toolu_bdrk_01BWmoT2NYtjBp4BSo72YRN3
Evidence from local database (opencode.db, table part)
{
"type": "tool",
"tool": "bash",
"callID": "toolu_bdrk_01BWmoT2NYtjBp4BSo72YRN3",
"state": {
"status": "error",
"input": {},
"raw": "",
"error": "Tool execution aborted"
}
}
### PluginsNone / no third-party plugins involved. Reproduced with built-in tools.### OpenCode version1.4.0### Steps to reproduce1. Start an OpenCode session on Windows Desktop with an Anthropic Claude model.2. Ask the assistant to run a long inline shell command through the bash tool, especially a long `python -c "..."` or `powershell.exe -Command` command with embedded script text.3. Let the assistant continue in the same session after the tool attempt fails or gets interrupted.4. Observe that one tool record may become `Tool execution aborted` with empty `input` and empty `raw`.5. Continue the same conversation.6. Eventually the session can become invalid and fail with an error like: `tool_use ids were found without tool_result blocks immediately after`.Note: I do not have a minimal deterministic repro yet, but this has happened multiple times in real sessions on Windows when the model emits long inline bash commands.### Screenshot and/or share link<img width="1131" height="1092" alt="Image" src="https://github.com/user-attachments/assets/c0caca8d-e51b-4f84-a510-b78529e04ab8" />### Operating SystemWindows11### TerminalWindows Desktop
I hit what looks like the same bug on Windows Desktop.
Additional reproduction pattern from my side:
Windows 11
OpenCode Desktop
Anthropic model
long inline shell commands are risky, especially:
long python -c "..."
long powershell.exe -Command ...
large Markdown/report workflows trigger it more often than normal code edits
code file edits are usually fine, but large .md writes seem much more likely to cause Tool execution aborted and later orphaned tool_use / missing tool_result
In my local database, the aborted tool record also had:
input: {}
raw: ""
error: "Tool execution aborted"
So from my side, Markdown-heavy workflows and long inline shell commands seem to be important triggers.
Activity
github-actions commentedon Apr 8, 2026
This issue might be a duplicate of existing issues. Please check:
NoahChaos commentedon Apr 8, 2026
I hit what looks like the same bug on Windows Desktop.
Additional reproduction pattern from my side:
python -c "..."powershell.exe -Command ....mdwrites seem much more likely to causeTool execution abortedand later orphanedtool_use/ missingtool_resultIn my local database, the aborted tool record also had:
input: {}raw: ""error: "Tool execution aborted"So from my side, Markdown-heavy workflows and long inline shell commands seem to be important triggers.