Skip to content

Cannot run any command, get error: read_powershell Invalid session ID #353

@VapidLinus

Description

@VapidLinus

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,

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions