Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

v2: WebSocket idle-timeout bypasses the 3-timeout retry cap, so a dead stream can hold a step for hours

未关闭 适合新手
#57,127 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@vkpdeveloper 已经在做这个了。

开始于 2026年10月22日。

  • #58076 来自 @vkpdeveloper —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
api, backend

调研方向

阅读packages/core/src/model-retry.ts,尤其是MAX_TIMEOUT_RETRIES策略和现有的HTTP超时测试。检查重试原因如何暴露WebSocket的idle-timeout代码,然后将它加入超时上限,并在策略测试中覆盖该情况。完成标准是:idle-timeout重试在与HTTP超时相同的上限处停止。

由索引模型根据 Issue 内容生成。

描述

reproduced
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
  1. Start a long task on an OpenAI model over the Responses WebSocket transport.
  2. Put the machine to sleep, or block network egress, mid-stream for a few minutes, then restore it.
  3. 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。