copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

copilot cli : Invalid session ID: read_sql_files. Please supply a valid session ID to read output from.

Open yassineMouttalib opened this issue 3 months ago • 5 comments

Describe the bug

copilot cli always throw this errors : ✘ read_bash Invalid session ID: read_sql_files. Please supply a valid session ID to read output from.

Affected version

~ % copilot --version 0.0.362 Commit: 0c95944

Steps to reproduce the behavior

using gemini 3 preview in complot cli in terminal (macbook)

Expected behavior

No response

Additional context

No response

yassineMouttalib avatar Nov 21 '25 18:11 yassineMouttalib

@shibbas @dereklegenzoff csn you take a look. More reports of sessionID issues.

EvanBoyle avatar Nov 22 '25 00:11 EvanBoyle

I also have this issue (0.0.363,0.0.362) (doesn't look like to be a model problem as i tested with sonnet 4.5, cortex5.1,gemini3) I downgraded to 0.0.351 and the issue doesn't exist with this version

amirkhaki avatar Nov 25 '25 14:11 amirkhaki

I have the same issue from 0.0.355 to latest version. 0.0.354 works fine for me.

I am on:

M4 Macbook Pro
macOS Sequoia 15.7.1
zsh 5.9 (arm-apple-darwin24.2.0)
wezterm 20240203-110809-5046fc22

I've manually tested bash --norc --noprofile with the commands that are stuck when executed by copilot and they all work fine.

gizotti avatar Nov 25 '25 23:11 gizotti

@EvanBoyle @shibbas @dereklegenzoff I got to the root cause of what is making it hang in my case.

We use direnv and nix to setup our projects and what it making the commands hang in my case is nix-direnv. If I remove that everything works fine. I don't know exactly why this is the case but I thought this might be helpful.

gizotti avatar Nov 26 '25 21:11 gizotti

I can confirm that it does now work in nix shell. I believe it worked before the update, though.

utzuro avatar Nov 28 '25 02:11 utzuro

For me, Copilot CLI 0.0.365 and 0.0.367 both result in errors such as

   Invalid session ID: 1. Please supply a valid session ID to read 

when the shell is configured by direnv allow.

@marksisson , I have found a work-around. I am using a nix develop shell. Entering the nix develop shell, then copilot, does not have the issue. This removes direnv from the equation.

peterbecich avatar Dec 07 '25 06:12 peterbecich

The original post in this thread does not mention direnv at all. I am opening a new thread for direnv specifically. I strongly suspect this issue #731 is caused by Zshell and direnv in combination: https://github.com/github/copilot-cli/issues/731

peterbecich avatar Dec 07 '25 06:12 peterbecich

I think the zshell/direnv combo is a red herring. ~~I'm seeing this behevior in the VS Code terminal window but not in an iTerm terminal window.~~ (edit: can't reproduce) Same project, same latest version of copilot-cli (0.0.369). I'm using nixos and devenv in both cases.

chazchandler avatar Dec 13 '25 01:12 chazchandler

@chazchandler , what is echo $SHELL in those two environments?

peterbecich avatar Dec 14 '25 09:12 peterbecich

I have the same problem without direnv. It might be a mix of zsh and nix. I don't get any issues when I open iterm and open a bash session.

zekena2 avatar Dec 15 '25 10:12 zekena2

@peterbecich:

$ echo $SHELL
/nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3/bin/bash
$ copilot
 Welcome to GitHub Copilot CLI
 Version 0.0.369 · Commit 83653a1

 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: chazchandler

 > run the tests

 ✓ Running tests with pnpm
   $ pnpm test
    └ 1 line...

 ✗ Read shell output
   Invalid session ID: 0. Please supply a valid session ID to read output from.

 ✓ List shells
   └ <no active sessions>

I haven't been able to get it working again in a regular terminal, so disregard what I said about there being a difference between terminals (vs code vs iterm). Seems like it's not entirely to do with zsh, though, since this is happening in bash too.

chazchandler avatar Dec 15 '25 15:12 chazchandler

@chazchandler I can't reproduce the issue with bash. It works fine with bash in my test: https://github.com/github/copilot-cli/issues/731

peterbecich avatar Dec 16 '25 23:12 peterbecich

I have this issue in copilot CLI, too

Invalid session ID: 19. Please supply a valid session ID to read output from.

I use Ubuntu, nix, direnv and nix-direnv.

guettli avatar Jan 09 '26 15:01 guettli

I had the same issue for some time. I now run copilot 0.0.371 and it works fine.

fstaffa avatar Jan 09 '26 16:01 fstaffa

I had the same issue for some time. I now run copilot 0.0.371 and it works fine.

I mean downgrading helps? I run 0.0.377 and have these issues (my env: Linux, bash, nix-direnv, inside tmux, connected via Android termux ssh)

guettli avatar Jan 09 '26 17:01 guettli

Unfortunately I don’t know, I haven’t tried a newer version.

Running nixos, nix home manager, zsh

-------- Original Message -------- On Friday, 01/09/26 at 18:57 Thomas Güttler @.***> wrote:

guettli left a comment (github/copilot-cli#640)

I had the same issue for some time. I now run copilot 0.0.371 and it works fine.

I mean downgrading helps? I run 0.0.377 and have these issues (my env: Linux, bash, nix-direnv, inside tmux, connected via Android termux ssh)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

fstaffa avatar Jan 09 '26 18:01 fstaffa