Skip to content

PowerShell Shell Sessions Dying Silently #1501

@39otsu

Description

@39otsu

Describe the bug

GitHub Copilot CLI 0.0.411-1
Windows_NT
Copilot CLI 0.0.411-1
Python 3.14

Affected version

GitHub Copilot CLI 0.0.411-1

Steps to reproduce the behavior

  1. Start a Copilot CLI session.
  2. Execute any powershell tool call (sync or async mode).
  3. The tool returns a shellId and reports the command is "still running after N seconds."
  4. Call read_powershell with the returned shellId.
  5. Response: "Invalid shell ID: <id>. Please supply a valid shell ID to read output from." and "<no active shell sessions>".

Expected behavior

Shell sessions should remain alive and readable for the duration of the command execution, or at minimum return output before dying.

Additional context

  • Every shell session dies between the powershell invocation and the subsequent read_powershell call.
  • This occurs regardless of:
    • Command complexity: Fails on echo "hello", Write-Output "test", Get-Content, python -c "...", python script.py, Test-Path.
    • Mode: Both mode="sync" and mode="async" produce the same result.
    • Wait time: initial_wait values of 30, 45, 60, 90, 120, 180, and 300 seconds all fail identically.
    • Shell ID format: Auto-generated numeric IDs (8 through 19) and custom string IDs (sdk-check, test-shell) all fail.
  • Shell sessions did work earlier in this same session such as the initial pip install, YAML loading verification, py_compile checks, and output manager tests all completed successfully with output.
  • The failure started occurring consistently after approximately 14 successful shell invocations.

Shell IDs That Failed (in order)

Shell ID Command Result
8 python main.py (first full run) Produced partial output, then session died on read_powershell
9 python -c "..." (SDK debug) No output, session died
10 python -u -c "..." (SDK debug) No output, session died
11 python -u -c "import copilot..." No output, session died
12 python -m pip show github-copilot-sdk No output, session died
sdk-check python -m pip show github-copilot-sdk No output, session died
13 python _debug_sdk.py No output, session died
14 Remove-Item ... No output, session died
15 python main.py (second run) No output, session died
16 python main.py > file 2>&1 No output, session died
17 Get-Content file No output, session died
18 Test-Path file No output, session died
19 echo "hello" No output, session died
  • Cannot run, test, or verify any code changes.
  • Cannot execute any CLI commands (build, test, install, run).
  • Effectively blocks all tool-assisted development work for the remainder of the session.
  • The view, create, edit, and grep/glob file tools continued working throughout, only PowerShell sessions were affected.

Metadata

Metadata

Labels

area:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions