fix(opencode): default header timeout to five minutes - #46903
Merged
Merged
Conversation
alltomatos
pushed a commit
to alltomatos/opencode
that referenced
this pull request
Sep 15, 2026
headerTimeout and chunkTimeout were only enforced when a provider config explicitly set them; with no config at all, a stalled connection (no response headers, or an SSE stream that stops emitting chunks without closing) could hang a request indefinitely. Ported from upstream/dev (fix(opencode): default header timeout to five minutes anomalyco#46903, fix(opencode): default chunk timeout to five minutes anomalyco#44890): default both to 300000ms when unset, and update the config schema descriptions to document the default. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KrFrdVEmx7apnofWUViJw
logic10492
added a commit
to coding-chimera/chimera
that referenced
this pull request
Sep 17, 2026
Port upstream opencode b04697366f (anomalyco/opencode#46903), extending the user-approved #14 timeout-default decision to the header phase (same rationale as the chunkTimeout default: half-dead relay streams must stop hanging indefinitely; the header phase has an even smaller risk surface since the timer stops once headers arrive). - resolveSDK: headerTimeout ?? 300_000, mirroring the chunkTimeout default; false still disables (headerTimeoutMs === false -> no controller), configured values unchanged. - Config schema: headerTimeout already accepted Union(PositiveInt, Literal(false)); descriptions synced to the upstream terminal wording '(default: 300000)'. - OPENAI_HEADER_TIMEOUT_DEFAULT is KEPT (not merged into the global default): upstream retains the loader-level injection at this sha, and it is not redundant in observable semantics - it keeps the default visible in openai.options.headerTimeout (pinned by two fork tests) and config-overridable at the provider level. A comment now documents the relationship with the resolveSDK global default (identical value, single file, no drift surface). - getResponsesTransport keeps raw pass-through semantics (headerTimeout is not part of ResponsesTransport options at all; same treatment as chunkTimeout in the previous batch). - Tests mirror upstream: default-applied-at-fetch loop covers both timeouts with the other explicitly disabled; 'opt-in for non-OpenAI' test becomes 'can be disabled with false'; the OpenAI disable test adopts the upstream 4eb29a64f0 terminal state (header AND chunk asserted false). Upstream-Sha: b04697366f05419e9bd7a92f841813dd976161c9
rossigee
pushed a commit
to rossigee/opencode
that referenced
this pull request
Sep 18, 2026
rldona
pushed a commit
to rldona/FlupCode
that referenced
this pull request
Sep 24, 2026
Jovan1666
pushed a commit
to Jovan1666/opencode
that referenced
this pull request
Oct 4, 2026
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.
Sets the default timeout for waiting for provider response headers to five minutes (300,000 ms), so requests don't wait indefinitely before a response starts. The timer stops once headers arrive and does not limit the streamed response body. OpenAI's existing five-minute header timeout is unchanged.
To disable it for a provider, set
headerTimeouttofalsein your project'sopencode.jsonor global~/.config/opencode/opencode.json:{ "provider": { "anthropic": { "options": { "headerTimeout": false } } } }Replace
anthropicwith your provider. To change the timeout instead, use a positive number of milliseconds, such as"headerTimeout": 600000for ten minutes. Omit the setting to use the five-minute default.