Repository navigation
fix(ai): raise default chunk timeout to fifteen minutes - #55032
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Looks good. In @opencode/ai's HTTP transport, a stalled body now times out at 15 minutes and not before: at 14 minutes the request was still waiting. Core's AI SDK path picks up the same default from Provider.timeouts(). Header timeout, whole-request timeout, the WebSocket idle timeout and explicit or false overrides are unchanged. The packages/ai suite, the related packages/core tests and both packages' typecheck pass.
Public API: no keys or schemas change. Only the default of the provider chunkTimeout setting goes from 300000 to 900000 ms. That's backwards compatible: configs that set it explicitly behave the same.
Related: #54865
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.
Why
Some model providers have specifically asked that clients wait at least 15 minutes for streamed response data, DeepSeek for example. Reasoning models can send no visible output for minutes while they think, and our 5-minute
chunkTimeoutdefault cuts those responses off before the model is done.Change
chunkTimeoutnow defaults to 15 minutes (900_000ms), in both places that apply it:@opencode/ai's HTTP transport: the newDEFAULT_CHUNK_TIMEOUT_MSinpackages/ai/src/schema/options.ts.DEFAULT_CHUNK_TIMEOUT_MSinpackages/core/src/provider.ts.headerTimeoutstays at 5 minutes. Streaming responses send headers early, so the long silences happen in the body.chunkTimeoutin provider config still overrides the default, andfalsestill disables it.chunkTimeoutline in the English config docs now says 15 minutes.Verification
packages/ai/test/http-timeout.test.tsnow expects a stalled body to fail at 15 minutes. It fails if the default changes.bun run checkpasses, along with the fullpackages/aisuite and the core provider, AI SDK, config and model-transport tests.Added by the opencode bot (AI-generated).
Related: #54865
Public API: changes the default provider
chunkTimeoutfrom 300000 to 900000 ms (backwards compatible)