Windows: opencode run --standalone exits without invoking plugin cleanup
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- bun, typescript
调研方向
Start with the repro in the linked e2e/repros/standalone-cleanup directory: repro.ts and plugin.ts, then the README for expected receipts. Find where opencode run --standalone tears down its plugin host on exit and why the cleanup function returned by the plugin is never awaited on Windows, while the serve --stdio path does await it. Done means the standalone run records setup, cleanup-start and cleanup-end on Windows, and the runner exits 0.
由索引模型根据 Issue 内容生成。
描述
[!NOTE]
🤖 gpt-6-astra responding on behalf of WhollyMindless
Description
On Windows, a successful opencode run --standalone exits without invoking a plugin's returned cleanup function. The same plugin completes asynchronous cleanup when an explicit server is shut down by closing its stdin ownership lease.
Discovered while developing opencode-self-improvement, then reduced to a 16-line probe independent of that plugin and its test harness.
Steps to reproduce
-
With Bun and OpenCode installed, run:
bun repro.ts # Or select a particular executable: bun repro.ts "C:\path\to\opencode.exe"
The runner uses a fixed loopback model response, fresh home/config/data directories, and only the probe plugin. No API key or dependency installation is needed. The probe synchronously records setup and returns an async function that records entry, awaits 10 ms, then records completion. It has no event subscribers or background work.
The control runs opencode serve --stdio, connects with run --server <url>, closes server stdin after the client exits, and awaits server exit. A watchdog kill or failed control yields an inconclusive result.
Expected / actual
Expected: both paths record setup, cleanup-start, cleanup-end before exiting.
Observed on both tested OpenCode versions:
standalone: CLI exit=0, answer=done
cooperative: CLI exit=0, answer=done
standalone receipts: setup
cooperative receipts: setup, cleanup-start, cleanup-end
REPRODUCED: standalone exited without completing plugin cleanup.
Even the synchronous cleanup-entry receipt is missing. The runner exits 1 for this result, 0 if both paths complete cleanup, and 2 for an inconclusive run. Full instructions and evidence. Verified outside the project checkout without node_modules.
Environment
- OpenCode: 2.4.2 and 2.0.26
- OS: Windows x64,
10.0.26200 - Runner: Bun 1.4.4; child processes launched directly, no interactive terminal involved
- Plugin: only the local cleanup probe
Related project tracking
- https://github.com/abogartz/opencode-self-improvement/issues/481 — host teardown measurement work.
- https://github.com/abogartz/opencode-self-improvement/issues/404 — earlier, fixed plugin-side capture cancellation issue; this report concerns cleanup never being invoked.
- https://github.com/abogartz/opencode-self-improvement/issues/554 and https://github.com/abogartz/opencode-self-improvement/pull/560 — development context and the committed standalone reproduction.
- 主要语言
- TypeScript
- 星标
- 230k
- 派生
- 31.3k
- 平均合并
- 5 小时 32 分钟
- 30 天内合并 PR
- 453
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
难度 1/5 1-3 小时 新手友好度 88/100
anomalyco/opencode#67064 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 82/100
anomalyco/opencode#67009 · 2 条评论 ·
维护者通常 1 天内回复
-
area/web type/feature version/v2
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#67001 · 3 条评论 ·
维护者通常 1 天内回复
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log可能已有人在做 @liwenjie200543 于 2 天前认领。 未关闭area/plugins platform/linux reproduced type/bug version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#66970 · 4 条评论 ·
维护者通常 1 天内回复
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks可能已有人在做 @argszero 于 2 天前认领。 未关闭area/tui platform/wsl status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#66773 · 4 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
enhancement feature/signals self-driving team/self-driving
难度 2/5 1-3 小时 新手友好度 78/100
PostHog/posthog#144208 · 1 条评论 ·
维护者通常 1 天内回复
-
bug good first issue web
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
triage: not actionable
难度 2/5 1-3 小时 新手友好度 66/100
oxc-project/oxc#30518 · 1 条评论 ·
维护者通常 1 天内回复
-
bug Claude useability
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 70/100
wazuh/wazuh-dashboard-plugins#9751 ·
维护者通常 1 天内回复