Skip to content

fix(opencode): default chunk timeout to five minutes - #46890

Merged
rekram1-node merged 3 commits into
devfrom
chunk-timeout
Sep 2, 2026
Merged

rekram1-node merged 3 commits into
devfrom
chunk-timeout

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

Sets the default timeout between streamed SSE response chunks to five minutes (300,000 ms). Stalled requests are aborted and retried using the existing retry policy. This limits inactivity between chunks, not the total response duration.

To disable it for a provider, set chunkTimeout to false in your project's opencode.json or global ~/.config/opencode/opencode.json:

{
  "provider": {
    "anthropic": {
      "options": {
        "chunkTimeout": false
      }
    }
  }
}

Replace anthropic with your provider. To change the timeout instead, use a positive number of milliseconds, such as "chunkTimeout": 600000 for ten minutes. Omit the setting to use the five-minute default.

@rekram1-node
rekram1-node merged commit 4eb29a6 into dev Sep 2, 2026
8 checks passed
@rekram1-node
rekram1-node deleted the chunk-timeout branch September 2, 2026 20:33
logic10492 added a commit to coding-chimera/chimera that referenced this pull request Sep 17, 2026
Port upstream opencode 4eb29a64f0 (anomalyco/opencode#46890), user-approved
behavior change (triage §11 decision #14 / briefing D3): SSE chunk idle
timeout now defaults to 300_000 ms for every provider instead of never
timing out, so half-dead relay streams stop hanging indefinitely. Set
chunkTimeout: false to explicitly disable; the config schema widens to
Union(PositiveInt, Literal(false)) mirroring the existing headerTimeout
shape, and the schema description documents the new default.

The default is applied where the fetch wrapper is built (resolveSDK) and
is not written back into provider options. The fork-specific
getResponsesTransport path keeps passing the raw configured value
(no default), matching its pre-change semantics; upstream has no
counterpart surface. b04697366f (headerTimeout default generalized to
all providers) is NOT part of this commit: the fork's headerTimeout
default remains OpenAI-only (OPENAI_HEADER_TIMEOUT_DEFAULT).

Tests: default applied at fetch (signal spy), configured 50ms timeout
aborts a stalled SSE body, chunkTimeout:false accepted end-to-end and
disables the abort.

Upstream-Sha: 4eb29a64f0054672950acf789f2b09487ebfbb20
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
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