GeezerVison is showing github.com — tool: long-running shell calls aborted with 'Tool execution interrupted', partial output lost · Issue #63752 · anomalyco/opencode
tool: long-running shell calls aborted with 'Tool execution interrupted', partial output lost #63752DescriptionSummary
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
- 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).
- While it runs, type and send a new message in the prompt (e.g. a follow-up or "status?").
- 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.
Activityopencodejr commented on Nov 13, 2026 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:
- 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).
- Could an Esc keypress have reached the TUI while you typed? Esc interrupts the running work.
- Does it still happen with
~/.config/opencode/plugins/postman.ts temporarily removed?
- Did you send with plain Enter, or with Ctrl+X then Enter (queue)?
Related issues:
opencodejr commented on Nov 13, 2026 Closing this for now, since we haven't heard back. On 2.2.7, sending a follow-up while a long foreground shell call was running didn't abort it in my test. The command finished, the model got its full output, and my message was delivered afterwards. Without more detail I can't tell what stopped your calls. The things that would help are:
- the
opencode.log lines around an abort, and whether a "The server restarted while you were working…" message appeared
- whether an Esc keypress could have reached the TUI
- whether it still happens with the
postman.ts plugin removed
- whether you sent with plain Enter or with Ctrl+X then Enter
The lost partial output after an interrupt is tracked in #39565. A fix for it (#62977) landed on dev after 2.2.7.
If it still happens, reply here with any of those details and the issue will reopen.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|