github / github/copilot-cli

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

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

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

triage
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện copilot -i "Test of prompt." trong PowerShell trên Windows và kiểm tra nhật ký gỡ lỗi xung quanh sự kiện pending-request và mục Registering foreground session. Hoàn tất khi prompt ban đầu được thực thi ngay khi phiên tương tác sẵn sàng mà không cần tin nhắn thứ hai.

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

Đánh giá

Công nghệ
powershell, shell
Lĩnh vực
cli, operating-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

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.