Skip to content

fix: keep partial bash output on interrupt - #44

Merged
wowi42 merged 1 commit into
mainfrom
fix/partial-output-on-cancel
Nov 20, 2026
Merged

wowi42 merged 1 commit into
mainfrom
fix/partial-output-on-cancel

Conversation

@wowi42

@wowi42 wowi42 commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #41.

_run_shell catches CancelledError, kills the process tree with the same discipline as the timeout path, and returns the partial buffer with a new interrupted flag. Both callers (bash tool, background tasks) surface it as an [interrupted, partial output] note and an error status, so the next turn sees the partial output instead of re-running the command.

Tests: test_cancel_kills_child updated to expect a returned result, new test_cancel_keeps_partial_output. Full suite green locally (2320 passed).

Closes #41. Cancelling a running bash command (Esc) used to drop
everything it had printed, so the next turn re-ran it and paid for the
output twice. _run_shell now returns the buffered output with an
interrupted flag; the tool result is marked "interrupted, partial
output" and reaches the model like any other result.
@wowi42
wowi42 merged commit fcb692e into main Nov 20, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: keep partial tool output on interrupt

1 participant