[Bug] Windows: shell tool dies process-wide with "opencode-pty request timed out" after long service-mode session; only full reboot recovers
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 12/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- powershell, typescript
- 領域
- backend
調査の方向性
Start from the shell/PTY tool path in the TypeScript server and the source of the opencode-pty request timed out error, then reproduce with serve --service on Windows and inspect the managed-service logs around the run= id and shell-output 404/499 entries. Read #61644 for ConPTY teardown and #52049/#53416 for managed-service replacement before changing anything. The goal is a minimal trigger and a distinct dead-PTY error, not a patch from this thread.
索引モデルが issue の本文から書いたものです。
説明
Description
On Windows, after several hours of continuous use of opencode serve --service, the shell tool stopped working process-wide. Every command — including echo hi — failed immediately with:
opencode-pty request timed out
The failure was instant, not after the requested tool timeout. It affected the main session, subagents, other existing sessions, and brand-new sessions created afterwards: no session on that server instance had a working shell. File tools (read/write/edit/grep/glob), web search and model calls kept working, and the local model server stayed healthy, so the machine itself was fine.
I was connected through the Android client and could not restart the desktop process. Restarting the OpenCode client/app did not help: the server log shows no new cli starting line, and every entry kept run=c9657fd3 from the original 05:07:54Z start. A full Windows reboot fixed it immediately — the log then shows two fresh managed-service starts, at 13:36:12Z (run=63e68047, v2.3.0) and 13:36:18Z (run=b9a8957b, v2.3.2 after auto-update).
So a client restart is not enough; only a machine reboot cleared the wedged PTY service.
Plugins
None.
OpenCode version
2.3.0 at failure (channel=latest, local=false, args="[\"serve\",\"--service\"]"). Rebooted into 2.3.2 via auto-update.
Steps to reproduce
- Run OpenCode 2.3.0 on Windows in service mode (
serve --service) for several hours. - Connect from the Android app, open and switch several workspaces, and run many shell commands including at least one backgrounded command.
- Shell requests begin failing instantly with
opencode-pty request timed out. Confirm fresh sessions and subagents fail identically. - Restart the client app: no help, the managed service keeps the same
run=id. Perform a full OS reboot: fixed.
I cannot confirm which step is causal. This is what happened, not a minimised reproducer.
Operating System
Windows (PC; exact build not recorded).
Terminal
OpenCode Android app as remote client; the desktop service spawned C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE.
Evidence
Verbatim opencode.log lines (UTC):
2026-11-20T05:07:54.425Z ... message="cli starting" version=2.3.0 channel=latest local=false args="[\"serve\",\"--service\"]" run=c9657fd3
2026-11-20T06:20:40.167Z ... GET /api/shell/sh_.../output http.status=499
2026-11-20T06:27:41.949Z ... GET /api/shell/sh_.../output http.status=404
2026-11-20T06:43:47.132Z ... POST /api/experimental/session/<id>/wait http.status=499
2026-11-20T13:36:12.541Z ... message="cli starting" version=2.3.0 ... run=63e68047
2026-11-20T13:36:18.083Z ... message="cli starting" version=2.3.2 ... run=b9a8957b
Notes on the evidence: the exact string opencode-pty request timed out was not in opencode.log; it was returned by the tool layer to the agent. The 499s are client-cancelled long polls and also occur on earlier days, so they are context, not proof of cause. The shell-output 404 suggests the backgrounded shell disappeared. The strongest discriminator is that a brand-new session failed identically, so this is not session-local state.
Related issues
- #61644 — Windows ConPTY teardown hangs, leaked
OpenConsole.exe, same error string; open and still reproducing at v2.3.0. The hang also occurs when deleting a session removes its terminals. - #52049 / #53416 — Windows managed service replacement can lose persistent terminals.
- #63384 — browser/attach RPC hangs producing long 499s alongside
/api/event.
Questions for maintainers
- Is there a supported way to restart only the shell/PTY subsystem from a client or an HTTP endpoint, without killing the session?
- Should a dead PTY service return a distinct, actionable error instead of a generic request timeout?
- Was anything in 2.3.2 changed in this area, or should I re-test on the latest build?
- 主要言語
- TypeScript
- スター
- 227k
- フォーク
- 30.7k
- 平均マージ
- 3時間 57分
- マージ済み PR(30日)
- 484
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
[Site] Active section detection should respect scroll-margin-top対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea/web reproduced type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
anomalyco/opencode#65384 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/cli type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anomalyco/opencode#65379 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Shell tool: no upper bound on the timeout a model can ask for, so one call can hold a turn for hoursオープンarea/core platform/linux type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anomalyco/opencode#65254 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
inference/go type/feature
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#65148 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/providers type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anomalyco/opencode#64845 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offers対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンcatalog provider provider-compatibility
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
lidge-jun/opencodex#9037 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
slavakurilyak/awesome-ai-agents#1005 ·
-
kind/bug triage/unresolved
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
メンテナーはふだん 1 日以内に返信
-
effort:S P3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nightscout/nocturne#3735 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
wpilibsuite/systemcore-blocks-interface#641 ·
メンテナーはふだん 2 日以内に返信