Skip to content

Never auto-abort a healthy wait for the model's next token - #504

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-5640-stall-watchdog-aborts-live-coding-turns-with-stopped-after
Aug 22, 2026
Merged

Never auto-abort a healthy wait for the model's next token#504
TheGreatAxios merged 1 commit into
mainfrom
cl-5640-stall-watchdog-aborts-live-coding-turns-with-stopped-after

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Fixes the last remaining stall-watchdog false-abort: a long-but-healthy model wait right after a tool batch resolves (or right after submit) was flat-timed out at STALL_TIMEOUT_MS with no way to tell it apart from a genuinely dead stream, since both leave awaitingResponse: true / streamingType: null indefinitely. There is no cheap signal to distinguish "still coming" from "never coming" in that state, so this picks the least invasive fix: shouldAbortForStall now only fires on a stream that had already started producing tokens (text/thinking) and then went dead mid-flight; the awaiting-first-token case is exempted from auto-abort entirely and only surfaces via the existing notice, leaving the operator in control.

Added regression tests for the acceptance criteria: a healthy post-tool-batch wait never aborts, live sub-agent progress under an outstanding task call never aborts, a parallel fan-out and an open gate stay exempt, and a genuinely dead mid-stream hang still aborts and notices as before.

Fixes CL-5640
https://linear.app/abklabs/issue/CL-5640

awaitingResponse flips true with no signal to tell "still coming" from
"never coming" apart, both right after submit and the instant a tool
batch resolves. Auto-abort now only fires on a stream that had already
started producing tokens and then went dead mid-flight; the awaiting
case still surfaces via the notice instead of killing the turn.

Adds regression coverage for a healthy post-tool-batch wait and for
live sub-agent progress under an outstanding task call, both of which
must never auto-abort.
@linear-code

linear-code Bot commented Aug 22, 2026

Copy link
Copy Markdown

CL-5640

@TheGreatAxios
TheGreatAxios merged commit 1d61781 into main Aug 22, 2026
2 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.

1 participant