Skip to content

Windows: aborted bash tool call can leave a dangling tool_use without tool_result and corrupt the session #21489

Closed

Description

@NoahChaos

Description

Summary

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"
  }
}

### Plugins

None / no third-party plugins involved. Reproduced with built-in tools.

### OpenCode version

1.4.0

### Steps to reproduce

1. 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 System

Windows11

### Terminal

Windows  Desktop

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 8, 2026
  2. github-actions commented on Apr 8, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. NoahChaos commented on Apr 8, 2026

    @NoahChaos
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions