Skip to content

docs(cli): propagate chunkTimeout to streamText and document provider options#9795

Open
Fatty911 wants to merge 4 commits into
Kilo-Org:mainfrom
Fatty911:docs/chunk-idle-timeout-silent-dropout
Open

docs(cli): propagate chunkTimeout to streamText and document provider options#9795
Fatty911 wants to merge 4 commits into
Kilo-Org:mainfrom
Fatty911:docs/chunk-idle-timeout-silent-dropout

Conversation

@Fatty911
Copy link
Copy Markdown

@Fatty911 Fatty911 commented May 3, 2026

Closes #9797

Summary

Propagate chunkTimeout to Vercel AI SDK streamText timeout.chunkMs for silent stream dropout detection, and document it in the custom models guide.

Reads from both merged model/agent/variant options AND item.options (provider-level) so provider.<id>.options.chunkTimeout works as documented. Addresses kilo-code-bot review finding.

Files Changed

File Change
packages/opencode/src/session/llm.ts Pass chunkTimeout → streamText timeout.chunkMs
packages/kilo-docs/pages/code-with-ai/agents/custom-models.md Document chunkTimeout provider option

…amText

Add chunkTimeout propagation to Vercel AI SDK streamText timeout.chunkMs
for silent stream dropout detection. The config option already existed in
the provider schema and worked at the fetch wrapper level, but was not
passed through to the streamText call. This adds dual-layer protection
at both the fetch layer and the SDK stream consumer layer.

Also updates docs to document chunkTimeout with failure scenario and
recommended values (15-30s).
@vercel
Copy link
Copy Markdown

vercel Bot commented May 3, 2026

@Fatty911 is attempting to deploy a commit to the Kilo Code Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread packages/opencode/src/session/llm.ts Outdated
// Pass chunkTimeout from provider/model options to streamText for AI SDK-level
// chunk idle timeout detection. This catches silenced stream dropouts where
// the TCP connection stays open but no SSE chunks arrive. // kilocode_change
const chunkTimeout = typeof options["chunkTimeout"] === "number" ? options["chunkTimeout"] : undefined // kilocode_change
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.

WARNING: Provider-level chunkTimeout is not propagated to streamText

This reads only from the merged model/agent/variant options. The documented provider-level setting lives on item.options, and ProviderTransform.options(...) only uses provider options for derived defaults like setCacheKey; it does not merge arbitrary provider options into options. As a result, a config like the docs example under provider.<id>.options.chunkTimeout still won't set streamText({ timeout: { chunkMs } }), so the new SDK-layer timeout silently doesn't activate for the primary documented use case.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 3, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/kilo-docs/pages/code-with-ai/agents/custom-models.md
  • packages/opencode/src/session/llm.ts

Reviewed by gpt-5.5-2026-04-23 · 327,495 tokens

…ed options

ProviderTransform.options() does not merge arbitrary provider options into
the merged options object. Read chunkTimeout from item.options as a fallback
so provider.<id>.options.chunkTimeout works as documented.

Addresses kilo-code-bot review finding in PR Kilo-Org#9795.
@Fatty911 Fatty911 changed the title docs(cli): add chunkTimeout to provider options and propagate to streamText docs(cli): propagate chunkTimeout to streamText and document provider options May 3, 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.

chunkTimeout provider option not propagated to Vercel AI SDK streamText

1 participant