Repository navigation
fix(opencode): bound the opt-in Responses first-byte stall window by the stream readiness timeout - #14940
Merged
diegosouzapw merged 3 commits intoSep 28, 2026
Conversation
maxmad64bis
force-pushed
the
fix/responses-stall-harden
branch
from
September 27, 2026 12:54
4b7bbe0 to
6c8df9e
Compare
maxmad64bis
marked this pull request as ready for review
September 27, 2026 16:29
5 tasks done
…the stream readiness timeout
maxmad64bis
force-pushed
the
fix/responses-stall-harden
branch
from
September 28, 2026 17:56
6c8df9e to
d349b42
Compare
A non-positive readiness bound (STREAM_READINESS_TIMEOUT_MS=0) means no readiness ceiling, so the guard keeps the configured first-byte window instead of switching off. The cap only applies when the configured window exceeds a positive readiness bound; document why equal to the bound is enough (the guard consumes the first byte before chatCore's readiness check starts, so the two waits never race).
diegosouzapw
merged commit Sep 28, 2026
5f267fa
into
diegosouzapw:release/v3.8.51
10 of 16 checks passed
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.
Summary
A streamed Responses reply that stays silent past the configured first-byte window held the request until the stream readiness timeout (80-180 s) even with the opt-in stall guard: the window was not bounded by the readiness timeout. The window is now capped by the readiness timeout (default 80 s), keeping one rotation then failing fast on the stall arm. With the flag off, behavior is unchanged: the window is 0 and the readiness timeout stays the only bound.
Related Issues
Validation
npm run lint— ESLint on the touched files is cleantests/unit/opencode-responses-stall-harden.test.ts(new)Tests Added Or Updated
tests/unit/opencode-responses-stall-harden.test.ts(new, 25 cases): window matrix (flag off, non-Responses, 0, over-cap clamp, invalid), guard identity/reject, setup wiring, executor flag-off identity and flag-on rotation.Coverage Notes
open-sse/executors/opencodeResponsesStall.ts(window computation and cap): the window matrix of the new suite.open-sse/executors/opencode.ts(call site): the executor cases of the same suite (flag-off identity, flag-on rotation).Reviewer Notes
open-sse/executors/opencode.ts, one-line call site each): hunks are in different regions (stall site vs set-aside sites); whichever lands first, the other rebases.mutation-test-coverage --strictandcheck:dashboard-typecheck(NoAuthAccountCard.tsx, a file outside this PR) fail the same way on the release base and on fix(proxies): shorten refused-egress set-aside and rest slow egress #14891.Maintainer rework (merge-batch 2026-09-28)
STREAM_READINESS_TIMEOUT_MS=0means "no readiness bound", so a non-positive bound is now treated as no ceiling:resolveResponsesStallWindowMsreturns the configured window instead of 0, andsetupStallGuardno longer reports (or logs) a cap in that case. Before, the guard switched off exactly when it was the only first-byte bound left. The test that pinned the old behavior is inverted, plus onesetupStallGuardcase (both fail on the previous head, pass now).RESPONSES_FIRST_BYTE_TIMEOUT_MSconfigured aboveSTREAM_READINESS_TIMEOUT_MSwith the opt-in flag on; windows at or below the bound, readiness disabled, and the flag off are unchanged.release/v3.8.51tip (real merge). Focused:opencode-responses-stall-harden26/26; stall/watchdog/executor suites green exceptopencode-responses-first-byte-stall"flag off … untouched", which fails identically with the tip's sources (inherited).typecheck:core,check:open-sse-typecheck,check-file-sizegreen.