[Bug] Windows: shell tool dies process-wide with "opencode-pty request timed out" after long service-mode session; only full reboot recovers

オープン
#65,175 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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 の本文から書いたものです。

説明

area/service platform/windows type/bug version/v2
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
  1. Run OpenCode 2.3.0 on Windows in service mode (serve --service) for several hours.
  2. Connect from the Android app, open and switch several workspaces, and run many shell commands including at least one backgrounded command.
  3. Shell requests begin failing instantly with opencode-pty request timed out. Confirm fresh sessions and subagents fail identically.
  4. 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。