Visitar URL original
tool: long-running shell calls aborted with 'Tool execution interrupted', partial output lost · Issue #63752 · anomalyco/opencode · GitHub
Skip to content

tool: long-running shell calls aborted with 'Tool execution interrupted', partial output lost #63752

Open

Description

@albertVel

Summary

Long-running foreground shell tool calls (1-5 min AWS CLI scans / waits) were repeatedly aborted with Tool execution interrupted and all their output was lost, forcing the agent to re-run work.

Environment

  • opencode version: 2.2.7
  • OS: macOS (Darwin 25.6.0, arm64)
  • Terminal: VS Code integrated terminal 1.145.2 (TERM=xterm-256color, TERM_PROGRAM=vscode)
  • Shell: /bin/zsh
  • Install/channel: latest
  • Active plugins: 1 local plugin (~/.config/opencode/plugins/postman.ts)

Reproduction

  1. Start a session and let the agent run a long foreground shell command (e.g. a loop of AWS CLI calls taking several minutes, timeout set to 120-300s).
  2. While it runs, type and send a new message in the prompt (e.g. a follow-up or "status?").
  3. Observe the running tool call.

Expected Behavior

Either the running tool call finishes and the new message is queued, or the user is clearly told that sending a message will abort the running tool. Partial output collected so far should be kept.

Actual Behavior

The tool call ends with {"error":{"type":"aborted","message":"Tool execution interrupted"},"content":[]} and no partial output is returned. Happened ~8 times in one session.

Additional Context

  • Not 100% sure every abort was caused by sending a message; some may have happened without user input.
  • Workaround: running commands with background: true avoided the problem.

Activity

  1. opencodejr commented on Nov 13, 2026

    @opencodejr

    Thanks for the detailed report. I couldn't reproduce the abort on 2.2.7.

    What I tried: the TUI with a simulated model. The model ran a ~25-second foreground shell loop (for i in $(seq 1 25); do echo tick-$i; sleep 1; done, timeout 300000). Partway through I typed status? and pressed Enter. The shell call kept running and finished, and the model got the full output. My follow-up was delivered after the command completed. There was no Tool execution interrupted. That matches how it is meant to work: plain Enter while OpenCode is working steers the session, and the message is picked up at the next step boundary, not by stopping the running tool. I tested on Linux, not macOS or the VS Code terminal, and without your plugin.

    On the lost output: when a shell call is interrupted, 2.2.7 discards what it had printed so far. That is tracked in #39565, and a fix (#62977) landed on dev after 2.2.7.

    To find what is stopping your calls, these would help:

    1. Around one of the aborts, did the session show a message like "The server restarted while you were working…"? Could you share the opencode.log lines from a minute before to a minute after an abort, with anything private removed? A restart of the background service would interrupt running tools without any input from you (see tui: shared service is killed after 45s of SSE silence, causing cross-session restart loops #63357, also 2.2.7 in the VS Code terminal with a plugin installed).
    2. Could an Esc keypress have reached the TUI while you typed? Esc interrupts the running work.
    3. Does it still happen with ~/.config/opencode/plugins/postman.ts temporarily removed?
    4. Did you send with plain Enter, or with Ctrl+X then Enter (queue)?

    Related issues:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions