Detached PowerShell command is reported completed while its child process is still running
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Describe the bug
In a GitHub Copilot app project session on Windows, the built-in powershell tool was started with mode="async" and detach=true. A later read_powershell call reported <detached command with shellId: runtime-tests-detached completed> even though the child process continued writing its receipt for another 6 minutes 51 seconds.
No later completion notification was recorded, and the wrapper's final exit-code/output receipt was never delivered.
Frequency: observed once during a long-running pytest command. I have not yet reproduced it with a minimal sleep-only command.
Extensions: not tested with extensions disabled. No extension initiated the command; it was launched through the built-in PowerShell tool.
Affected version
GitHub Copilot CLI 1.0.80 embedded in GitHub Copilot app 1.1.14
Steps to reproduce the behavior
- In a GitHub Copilot app project session on Windows, have the agent launch a long-running child process through the built-in PowerShell tool using
mode="async",detach=true, and a namedshellId. - Redirect the child process output to a file. Keep the wrapper waiting for the child and printing a final receipt only after it exits.
- End the agent turn.
- While the child is still producing output, call
read_powershellfor thatshellId. - Observe that it reports the detached command as completed.
- Observe that the redirected output file continues changing after the reported completion time.
Observed timeline in this run:
- 03:51:40Z — detached PowerShell tool launched.
- 03:51:42Z — tool returned
command started in detached background. - 04:01:43Z —
read_powershellreported the detached command completed. - 04:08:34Z — the redirected receipt file was still being written.
Expected behavior
Detached-command status should track the full command process tree. read_powershell and any completion notification should report completion only after all command descendants exit and the real exit code/final output are available.
If detached descendants are intentionally untracked, the tool should report that the command is detached/untracked rather than completed.
Additional context
App version 1.1.14
OS Windows 10 Enterprise 25H2 (build 26200.9106)
Architecture AMD64
WebView2 runtime 152.0.4191.62
Copilot CLI 1.0.80
Agency 2026.9.2.6
GPU 0 Intel(R) Graphics (32.0.101.8132)
GPU 1 NVIDIA GeForce RTX 5090 (32.0.16.1656)
Suggested triage labels: area:tools, area:platform-windows, area:sessions.
The event log contains a launch event and the premature manual completion read, but no intervening completion/system-notification event. The output file's LastWriteTimeUtc proves activity continued after the completion report.
Related but not duplicate: github/app#330 reports premature completion notifications for sub-agents; this report concerns detached shell process-tree tracking.
Workaround: pair detached finite jobs with a recurring same-session automation that checks once per wake and clears itself after a genuine final receipt.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 Windows 上内置 powershell 工具的 async detached 处理和 read_powershell 入口点开始。使用一个最小的长时间运行子进程重现报告,然后比较 detached 状态、完成通知和最终 receipt。只有当状态和通知会等待命令的后代进程及真实的最终输出,或明确将它们标识为未跟踪时,才算完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- powershell
- 领域
- cli, operating-systems
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100