v2: WebSocket idle-timeout bypasses the 3-timeout retry cap, so a dead stream can hold a step for hours
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
阅读packages/core/src/model-retry.ts,尤其是MAX_TIMEOUT_RETRIES策略和现有的HTTP超时测试。检查重试原因如何暴露WebSocket的idle-timeout代码,然后将它加入超时上限,并在策略测试中覆盖该情况。完成标准是:idle-timeout重试在与HTTP超时相同的上限处停止。
由索引模型根据 Issue 内容生成。
描述
Description
A WebSocket stream that goes silent fails with transport code idle-timeout after 30 minutes (packages/core/src/session/model-transport.ts:418-424, IDLE_TIMEOUT = "30 minutes"). The retry policy only counts code === "Timeout" toward MAX_TIMEOUT_RETRIES = 3 (packages/core/src/model-retry.ts:53). So an idle-timeout falls under the general 10-retry allowance, and one dead step can hold a session or subagent for hours.
This shows up after a laptop sleeps or the network drops with agents mid-run. On a v2.0.32 install over one week, 264 model requests failed on transport and took 54.8 request-hours. One review subagent spent 243 of its 256 minutes in 9 failed requests ("Timed out waiting for WebSocket data", "WebSocket closed with code 1006"), each about 15-40 min. The agent also sees these as failed tool calls with empty input (patch {}), so it changes its own behavior instead of recognising a provider stall.
Expected: an idle-timeout counts toward the timeout cap like an HTTP Timeout, the same reasoning as the comment above MAX_TIMEOUT_RETRIES.
Possible fix: in model-retry.ts, count reason.code === "idle-timeout" (WebSocket) along with "Timeout", plus a policy test next to the existing HTTP timeout test.
Plugins
Local plugins only (cache TTL, cost); none touch transport or retry.
OpenCode version
2.0.32 (code references from dev at ce15cd882)
Steps to reproduce
- Start a long task on an OpenAI model over the Responses WebSocket transport.
- Put the machine to sleep, or block network egress, mid-stream for a few minutes, then restore it.
- The step waits 30 min for
idle-timeout, then retries under the general allowance instead of the 3-timeout cap.
Operating System
macOS 27
Terminal
OpenCode TUI
- 主要语言
- TypeScript
- 星标
- 221k
- 派生
- 29.6k
- 平均合并
- 5 小时 32 分钟
- 30 天内合并 PR
- 492
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anomalyco/opencode#60174 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
anomalyco/opencode#60143 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#60121 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#59973 · 1 条评论 ·
维护者通常 1 天内回复
-
triaging
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#59942 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
fix(worker): keep normal prepare waiting states failure-free可能已有人在做 @LichKing-2234 今天认领。 未关闭agent:codex priority:P1
难度 2/5 1-3 小时 新手友好度 72/100
AgoraIO-Extensions/agent-infra#3745 ·
维护者通常 1 天内回复
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framing可能已有人在做 @Eapp1e 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
makecindy/cindy#7973 · 1 条评论 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 78/100
lingdojo/kana-dojo#33337 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
code-yeongyu/senpi#4917 · 1 条评论 ·
维护者通常 1 天内回复