[Bug] -i initial prompt can remain pending until a second user message on Windows
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
説明
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
- On Windows, open PowerShell.
- Run
copilot -i "Test of prompt.". - Observe that the interactive UI launches but the supplied prompt may remain unexecuted.
- Submit any second message in the session.
- 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 / NeedsRemediationto1.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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Windows の PowerShell で copilot -i "Test of prompt." を再現し、pending-request イベントと Registering foreground session エントリの周辺にあるデバッグログを調べます。インタラクティブセッションの準備が整うとすぐに初期プロンプトが実行され、2 回目のメッセージを必要としなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- powershell, shell
- 領域
- cli, operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100