copilot cli : Invalid session ID: read_sql_files. Please supply a valid session ID to read output from.
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
@shibbas @dereklegenzoff csn you take a look. More reports of sessionID issues.
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
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.
@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.
I can confirm that it does now work in nix shell. I believe it worked before the update, though.
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.
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
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 , what is echo $SHELL in those two environments?
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.
@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 I can't reproduce the issue with bash. It works fine with bash in my test: https://github.com/github/copilot-cli/issues/731
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.
I had the same issue for some time. I now run copilot 0.0.371 and it works fine.
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)
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: @.***>