github / github/copilot-cli

[Bug] -i initial prompt can remain pending until a second user message on Windows

Abierto
#4,784 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

triage
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

Describe the bug

Starting Copilot CLI with -i/--interactive <prompt> can open the interactive session without executing the supplied initial prompt. The terminal remains responsive. After the user submits another message, the original initial prompt is then executed automatically.

Debug logging shows the pending request is emitted before the foreground session host is registered:

[WARNING] pending-request event was not delivered to the session host
GenericFailure, no session host is registered for session <redacted>
...
[INFO] Starting Copilot CLI: 1.0.84-3
...
[INFO] Registering foreground session: <redacted>

This appears to be a startup ordering/race issue rather than command-line quoting or CR/LF handling.

Affected version

GitHub Copilot CLI 1.0.84-3

Steps to reproduce the behavior
  1. On Windows, open PowerShell.
  2. Run copilot -i "Test of prompt.".
  3. Observe that the interactive UI launches but the supplied prompt may remain unexecuted.
  4. Submit any second message in the session.
  5. Observe that the original Test of prompt. request is then executed automatically.

The same diagnostic ordering occurs when invoking the WinGet executable directly:

& "$env:LOCALAPPDATA\Microsoft\WinGet\Links\copilot.exe" -i "Test of prompt."
Expected behavior

The prompt supplied through -i should execute automatically as soon as the interactive session is ready, without requiring another user message.

Additional context
  • Date reproduced: September 9, 2026
  • OS: Windows, x64
  • Shell: PowerShell 7.6.5
  • Terminal hosts tested: Windows Console Host and Windows Terminal
  • Copilot CLI: 1.0.84-3 (reported as latest)
  • Both the WindowsApps launch alias and direct WinGet executable were tested.
  • The WindowsApps package was repaired from 1.0.83.0 / NeedsRemediation to 1.0.84.0 / Ok; the pending-request warning still occurred afterward with both launch paths.
  • Fresh traces consistently recorded the warning about no registered session host roughly 1.2 seconds before Registering foreground session.
  • Full debug logs are not attached because they may contain environment/account metadata, but can be provided privately if requested.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza reproduciendo copilot -i "Test of prompt." en PowerShell en Windows e inspecciona el registro de depuración alrededor del evento pending-request y de la entrada Registering foreground session. Se considera completado cuando el prompt inicial se ejecuta en cuanto la sesión interactiva está lista, sin requerir un segundo mensaje.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
powershell, shell
Área
cli, operating-systems
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.