Files
sbt/notes/2.0.0/cancel-discards-output.md
T
BrianHotoppandClaude Fable 5 b4d628dd32 [2.x] fix: Discard a cancelled task's output backlog on cancel (#9411)
A task that floods stdout could not be stopped promptly: cancelling it
(Ctrl+C from the thin client) stopped the task, but the server kept
draining the already-queued output to the client for several seconds,
because onCancellationRequest never discarded the pending backlog.

onCancellationRequest now sets a per-channel isCanceled flag and clears the
queued frames and buffered stdout (discardPending), and jsonRpcNotify
drops the cancelled task's systemOut/systemErr while the flag is set, so
output stops promptly.

Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-12 15:03:45 -04:00

463 B

Cancelling a task discards its queued output

Previously, cancelling a task that was producing a lot of output (Ctrl+C from the thin client) stopped the task, but the server kept draining the already-queued output to the client for several seconds, so the cancel appeared not to take effect. The cancelled task's buffered stdout/stderr is now discarded on cancel, so output stops promptly. Control-plane messages and the next command's output are unaffected.