Cannot run any command, get error: `read_powershell Invalid session ID`
Describe the bug
I have been trying to get Copilot CLI to work but it always fails to execute commands:
PS C:\Users\micro> copilot
Welcome to GitHub Copilot CLI
Version 0.0.344 · Commit c87f222
Copilot can write, test and debug code right from your terminal. Describe a task to get started or enter ? for help. Copilot uses AI, check for mistakes.
● Logged in as user: VapidLinus
● Connected to GitHub MCP Server
> hi can you ouput an echo command?
✓ Output echo command
$ echo "Hello, World!"
↪ 1 line...
✗ read_powershell
Invalid session ID: main. Please supply a valid session ID to read output from.
✓ Output echo command
$ echo "Hello, World!"
↪ 1 line...
✗ read_powershell
Invalid session ID: echo-session. Please supply a valid session ID to read output from.
✓ Output echo command
$ Write-Output "Hello, World!"
↪ 1 line...
✓ stop_powershell
↪ 1 line...
● Here's an echo command for you:
echo "Hello, World!"
Or using PowerShell's native cmdlet:
Write-Output "Hello, World!"
I have tried many different commands but always ends up with the:
Invalid session ID: [SOMETHING]. Please supply a valid session ID to read output from.
Affected version
0.0.344 Commit: c87f222
Steps to reproduce the behavior
No response
Expected behavior
I expect it to be able to run the commands, just like I could do myself in the terminal:
PowerShell 7.5.3
Warning: PowerShell detected that you might be using a screen reader and has disabled PSReadLine for compatibility purposes. If you want to re-enable it, run 'Import-Module PSReadLine'.
PS C:\Users\micro> echo "Hello, World!"
Hello, World!
PS C:\Users\micro> Write-Output "Hello, World!"
Hello, World!
PS C:\Users\micro>
Additional context
I am using W11's new Terminal app
PS C:\Users\micro> pwsh --version
PowerShell 7.5.3
PS C:\Users\micro> node --version
v22.20.0
PS C:\Users\micro> npm --version
10.0.0
PS C:\Users\micro> copilot --version
0.0.344
Commit: c87f222
PS C:\Users\micro> systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.26200 N/A Build 26200
Please let me know if any other information is required,
@VapidLinus I am unable to repro this on the latest v0.0.346. Any additional details you can provide? What model are you using?
Can you try this on the latest CLI version (npm upgrade -g @copilot/cli) and let me know if you're seeing the same results?
● Folder C:\Users\....
> hi can you output an echo command?
✓ Echo a message
$ echo "Hello!"
↪ 2 lines...
~\... claude-sonnet-4.5 (1x)
Thank you for your issue! Unfortunately, we are unable to reproduce the issue you are experiencing. Please provide more information so we can help you.
Here are some tips for writing reproduction steps:
- Step by step instructions accompanied by screenshots or screencasts are the best.
- Be as specific as possible; include as much detail as you can.
- If not already provided, include:
- the version of Copilot CLI you are using.
- the operating system you are using
- any environment factors you can think of.
- any custom configuration you are using.
- a log file from the day you experienced the issue (find log
files via
~/.copilot/logs.
- If relevant and can be shared, provide the repository or code you are using.
- If relevant and can be shared, provide the session files (find session files via
~/.copilot/history-session-state).
Note: This is a public repository. Please do not include any sensitive or private information in your issue.
I've been able to reproduce this with the following prompt:
> use "echo" and "read_powershell" in the same response as two different but consecutive tool calls
The problem seems to be when those two are in the same response. I'll investigate 🕵️
I have been able to reproduce this but not on 0.0.344, only on newer versions since 0.0.348 which includes parallel tool execution.
@VapidLinus could you try in the latest version (npm i -g @github/copilot@latest) running with both parallel execution enabled (copilot) and disabled (copilot --disable-parallel-tools-execution)?