[FEATURE]: Preserve partial bash output for the model after abort #9449

Open
opened 2026-02-16 18:12:28 -05:00 by yindo · 0 comments
Owner

Originally created by @jakvbs on GitHub (Feb 16, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When a long-running bash tool call is interrupted by the user (or timeout), OpenCode currently records the interruption, but the model does not receive the partial command output that was already produced before abort.

This creates a gap between what users saw in-flight and what the assistant can reason about afterward. In practice, useful diagnostics often appear early (first stack trace, first failed test, missing env var), so losing partial output forces unnecessary reruns and slows debugging.

Current behavior

  • bash streams output while running (visible in UI/metadata updates).
  • On abort, the tool is marked interrupted/error.
  • The next model turn gets interruption/error context, but not the partial log content.

Requested behavior
On interrupted bash runs, include bounded partial output in the tool result/context with explicit incomplete markers, e.g.:

  • interrupted: true
  • complete: false
  • interruption_reason: "user_abort" | "timeout"

Why this is useful

  • Lets the assistant diagnose immediately from already-produced logs.
  • Reduces reruns of expensive build/test/e2e commands.
  • Keeps behavior transparent by marking output as incomplete.

Guardrails

  • Keep existing truncation/size limits.
  • Prefer tail-focused partial output if token budget is tight.
  • Preserve current semantics for fully completed tool calls.

Acceptance criteria

  • After aborting a bash command, the model receives partial output (bounded/truncated).
  • Partial output is explicitly marked as incomplete/interrupted.
  • No regression in tool-call/tool-result consistency.

Related context: #10670, #13338, #13589, #8497

Originally created by @jakvbs on GitHub (Feb 16, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request When a long-running `bash` tool call is interrupted by the user (or timeout), OpenCode currently records the interruption, but the model does not receive the partial command output that was already produced before abort. This creates a gap between what users saw in-flight and what the assistant can reason about afterward. In practice, useful diagnostics often appear early (first stack trace, first failed test, missing env var), so losing partial output forces unnecessary reruns and slows debugging. **Current behavior** - `bash` streams output while running (visible in UI/metadata updates). - On abort, the tool is marked interrupted/error. - The next model turn gets interruption/error context, but not the partial log content. **Requested behavior** On interrupted `bash` runs, include bounded partial output in the tool result/context with explicit incomplete markers, e.g.: - `interrupted: true` - `complete: false` - `interruption_reason: "user_abort" | "timeout"` **Why this is useful** - Lets the assistant diagnose immediately from already-produced logs. - Reduces reruns of expensive `build/test/e2e` commands. - Keeps behavior transparent by marking output as incomplete. **Guardrails** - Keep existing truncation/size limits. - Prefer tail-focused partial output if token budget is tight. - Preserve current semantics for fully completed tool calls. **Acceptance criteria** - After aborting a `bash` command, the model receives partial output (bounded/truncated). - Partial output is explicitly marked as incomplete/interrupted. - No regression in tool-call/tool-result consistency. Related context: #10670, #13338, #13589, #8497
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9449