Never auto-abort a healthy wait for the model's next token - #504
Merged
TheGreatAxios merged 1 commit intoAug 22, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: nullindefinitely. There is no cheap signal to distinguish "still coming" from "never coming" in that state, so this picks the least invasive fix:shouldAbortForStallnow 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
taskcall 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