fix(cli): recover stalled response streams - #11585
Conversation
|
|
||
| const customFetch = options["fetch"] | ||
| const chunkTimeout = options["chunkTimeout"] | ||
| const chunkTimeout = streamTimeout({ |
There was a problem hiding this comment.
WARNING: The new default idle timeout cannot be disabled from config
This makes STREAM_IDLE_TIMEOUT_MS apply to every provider that leaves chunkTimeout unset, but packages/opencode/src/config/provider.ts still defines chunkTimeout as PositiveInt. In practice that means users cannot set provider.<id>.options.chunkTimeout: 0 in kilo.json to opt out of the new 2-minute cutoff, so providers that legitimately pause for longer will now fail without a supported escape hatch.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Previous Review Summaries (3 snapshots, latest commit 7265d56)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 7265d56)Status: 1 Issue Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (12 files)
Previous review (commit 4bc9e27)Status: 1 Issue Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (5 files)
Previous review (commit f6805e0)Status: 1 Issue Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (7 files)
Reviewed by gpt-5.4-2026-03-05 · Input: 89.2K · Output: 8.1K · Cached: 252.4K Review guidance: REVIEW.md from base branch |
| const now = Date.now() | ||
| for (const [key, entry] of pool) { | ||
| if (entry.busy) continue | ||
| if (entry.fallback) continue // kilocode_change - port upstream #30586 |
There was a problem hiding this comment.
WARNING: Permanent fallback entries can accumulate per session
pool is keyed by session-id / x-session-affinity, so every session that exhausts websocket retries leaves behind one PoolEntry. Skipping fallback entries here means those entries are never removed until the plugin is disposed, which can turn into an unbounded map in long-lived CLI or extension processes. A bounded TTL for fallback entries would preserve the sticky fallback behavior without pinning every failed session forever.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
|
To stay organized pull requests are automatically closed after 30 days of inactivity. If the pull request is still relevant please reopen it or create a fresh new one. |
Foreground subagents could remain running indefinitely through two independent client-side wait paths.
A child could finish a command, begin the next model response, emit reasoning, and then receive no further stream data while the HTTP response remained open. Without a default chunk timeout, the stream neither completed nor failed, so session retry never ran and the parent Task continued awaiting the busy child.
Subagents also inherited the interactive
suggesttool. Calling it waits for a human to accept or dismiss an action, but a Task child has no reliable direct interaction surface. The child could therefore wait inside the tool while the parent only reported the Task as in progress.The response transport now applies a two-minute default idle timeout between SSE reads. Inactivity becomes the existing retryable
ProviderResponseStreamError, allowing normal session retry to resume the child. ExplicitchunkTimeoutvalues still override the default, and0continues to disable it. Provider-level timeout handling remains in the fetch wrapper so it preserves the typed failure required by the retry path.Task child prompts now disable
suggest, matching the existing restriction onquestion, so subagents cannot enter a human-interaction wait.The WebSocket retry tests and fallback lifecycle also include the corresponding later OpenCode fixes. Exhausted HTTP fallback state is retained instead of being pruned by the stream idle interval, and retry-failure tests terminate sockets through explicit readiness signals rather than depending on short wall-clock timeouts.