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

Đang mở
#65,175 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
12/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
powershell, typescript
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?
Ngôn ngữ chính
TypeScript
Star
227k
Fork
30.7k
Merge trung bình
3 giờ 57 phút
Pull request đã merge (30 ngày)
484

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.