Skip to content

fix(core): wait 10 minutes for headers on Gemini and DeepSeek models - #67243

Merged
rekram1-node merged 2 commits into
devfrom
long-header-timeout
Nov 30, 2026
Merged

rekram1-node merged 2 commits into
devfrom
long-header-timeout

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Gemini and DeepSeek models now get 10 minutes to send response headers instead of 5, on any provider that serves them. Every other model keeps the 5 minute default.

The default is picked from the model's catalog family, so it covers google, google-vertex, opencode, opencode-go, openrouter, deepseek, alibaba and others without listing providers or matching model ids:

 headerTimeout =
   settings.headerTimeout                        (provider or model config, number or false)
-  ?? 300_000
+  ?? (family starts with "gemini" or "deepseek" ? 600_000 : 300_000)

An explicit headerTimeout in config still wins. chunkTimeout (15 min) and the total timeout are unchanged.

Why

  • On Vertex, gemini-4-argon at medium thinking sent no headers until 285.7s on a large tool call, 14s under the current limit. On AI Studio the same model took 279 to 288s before headers.
  • DeepSeek's API keeps a queued request open for up to 10 minutes before inference starts.
  • The official OpenAI and Anthropic SDKs both default to 10 minutes.

Related: #56344

Trade-offs

A request that really is stuck on one of these models now takes 10 minutes to fail instead of 5. I kept the rule to these two families rather than raising the default for everyone, since other models have not shown this. Models without a catalog family (some custom config models) keep 5 minutes.

Verification

  • New test in packages/core/test/model-resolver.test.ts: Gemini and DeepSeek families resolve to 600_000 on google-vertex, opencode, deepseek and opencode-go; a Claude family and a model with no family stay at 300_000; explicit headerTimeout (number and false) wins.
  • bun test test/model-resolver.test.ts test/aisdk.test.ts and bun typecheck in packages/core, bun run check from root.

Added by the opencode bot (AI-generated).

Related: #56344

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sound. I called Provider.timeouts directly on the base and with this PR. Gemini and DeepSeek families (gemini-pro, gemini-flash-lite, deepseek-flash) now get a 600s header timeout. Other families and models with no family keep 300s, and an explicit headerTimeout still wins. All three callers pass the model family. The model-resolver and aisdk tests pass, and tsc -b on packages/core reports no errors. I didn't test against a real provider.

Public API: no config keys, schema, SDK or HTTP API change. Only the unset headerTimeout default changes, for these two families. Existing configs keep working.

One thing worth updating: the Timeouts section of services/site/src/docs/content/providers.mdx still says requests wait "up to five minutes for response headers". It should mention the 10-minute default for Gemini and DeepSeek models.

Related: #56344

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs point from my last review is fixed: the Timeouts section of providers.mdx now mentions the 10-minute header wait for Gemini and DeepSeek models. The new commit changes only that doc, so nothing new to raise. Public API unchanged.

@rekram1-node
rekram1-node merged commit 7badd5f into dev Nov 30, 2026
11 checks passed
@rekram1-node
rekram1-node deleted the long-header-timeout branch November 30, 2026 03:44
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