github / github/copilot-cli

Detached PowerShell command is reported completed while its child process is still running

Ouverte
#4,719 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

area:platform-windows area:tools
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

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

  1. 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 named shellId.
  2. Redirect the child process output to a file. Keep the wrapper waiting for the child and printing a final receipt only after it exits.
  3. End the agent turn.
  4. While the child is still producing output, call read_powershell for that shellId.
  5. Observe that it reports the detached command as completed.
  6. 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_powershell reported 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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par la gestion async detached de l’outil powershell intégré et par le point d’entrée read_powershell sous Windows. Reproduisez le rapport avec un processus enfant minimal de longue durée, puis comparez le statut detached, les notifications d’achèvement et le receipt final. C’est terminé lorsque le statut et les notifications attendent les descendants de la commande et la sortie finale réelle, ou les identifient explicitement comme non suivis.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
powershell
Domaine
cli, operating-systems
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.