You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched open and closed issues and did not find a report of this problem.
I reviewed this report and removed credentials, tokens, private paths, hostnames, and other sensitive data.
Problem
When you quit an interactive session started with gentle-shell, Pi prints:
To resume this session: pi --session <id>
That command does not work: Pi answers No session found matching '<id>'. The hint sends users into an error at the exact moment they want to get back to their work.
Cause. The launcher starts Pi with PI_CODING_AGENT_DIR pointing at the gentle-shell home (~/.gentle-shell/agent in isolated mode, the default), and that is where sessions are stored. Pi builds the hint in formatResumeCommand (dist/modes/interactive/interactive-mode.js in 0.87.1) using its own binary name (pi). Because the session lives in the default session directory of that home, Pi adds no --session-dir and never mentions PI_CODING_AGENT_DIR. As a result, pi --session <id> looks in ~/.pi/agent and finds nothing.
What does work today is gentle-shell --session <id>, because the launcher passes --session through to Pi. Nothing tells the user that, though.
The clean fix belongs in Pi, and the community has already tried twice. Pi generates the hint, so Pi is the right place to fix it. Both community attempts were closed without a fix:
Neither has been reopened, and formatResumeCommand is unchanged on Pi's current main. Pi does not look likely to fix this soon.
So I propose a workaround in gentle-shell. It is not the ideal fix: gentle-shell would be correcting, from the outside, a message that Pi writes. But it keeps users out of the error until Pi fixes it. If Pi ever accepts either proposal, the workaround can be removed in favor of Pi's mechanism. I explain how I built it in a comment.
Steps to reproduce
Start gentle-shell in isolated mode (the default, without --link).
Send a prompt and wait for the answer, so the session is saved.
Quit with /quit or Ctrl+D.
Pi prints To resume this session: pi --session <id>.
Run that command as printed.
Expected and actual behavior
Expected: on exit, a command that resumes the gentle-shell session, for example gentle-shell --session <id> (with --link or --home <dir> if the session was started that way).
Actual: the hint suggests pi --session <id>, which ends with:
No session found matching '01a0e27a-82f7-7588-a9d8-f62d61259f66'
The session exists under ~/.gentle-shell/agent/sessions/<cwd>/, and gentle-shell --session <id> opens it without problems.
gentle-pi version
3.7.0
Pi version
0.87.1
Operating system
Windows (WSL)
Relevant logs or error output (optional)
$ pi --session 01a0e27a-82f7-7588-a9d8-f62d61259f66
No session found matching '01a0e27a-82f7-7588-a9d8-f62d61259f66'
Before submitting
Problem
When you quit an interactive session started with
gentle-shell, Pi prints:That command does not work: Pi answers
No session found matching '<id>'. The hint sends users into an error at the exact moment they want to get back to their work.Cause. The launcher starts Pi with
PI_CODING_AGENT_DIRpointing at the gentle-shell home (~/.gentle-shell/agentin isolated mode, the default), and that is where sessions are stored. Pi builds the hint informatResumeCommand(dist/modes/interactive/interactive-mode.jsin 0.87.1) using its own binary name (pi). Because the session lives in the default session directory of that home, Pi adds no--session-dirand never mentionsPI_CODING_AGENT_DIR. As a result,pi --session <id>looks in~/.pi/agentand finds nothing.What does work today is
gentle-shell --session <id>, because the launcher passes--sessionthrough to Pi. Nothing tells the user that, though.The clean fix belongs in Pi, and the community has already tried twice. Pi generates the hint, so Pi is the right place to fix it. Both community attempts were closed without a fix:
PI_CODING_AGENT_DIRin the hint when it is set. It was auto-closed as not planned by Pi's new-contributor policy. The author offered to implement it and got no reply.InteractiveModeOptions.formatResumeCommandoption so embedders can show their own command. That is exactly what gentle-shell would need. Both the issue and the PR were auto-closed under the same policy.Neither has been reopened, and
formatResumeCommandis unchanged on Pi's currentmain. Pi does not look likely to fix this soon.So I propose a workaround in gentle-shell. It is not the ideal fix: gentle-shell would be correcting, from the outside, a message that Pi writes. But it keeps users out of the error until Pi fixes it. If Pi ever accepts either proposal, the workaround can be removed in favor of Pi's mechanism. I explain how I built it in a comment.
Steps to reproduce
gentle-shellin isolated mode (the default, without--link)./quitor Ctrl+D.To resume this session: pi --session <id>.Expected and actual behavior
Expected: on exit, a command that resumes the gentle-shell session, for example
gentle-shell --session <id>(with--linkor--home <dir>if the session was started that way).Actual: the hint suggests
pi --session <id>, which ends with:The session exists under
~/.gentle-shell/agent/sessions/<cwd>/, andgentle-shell --session <id>opens it without problems.gentle-pi version
3.7.0
Pi version
0.87.1
Operating system
Windows (WSL)
Relevant logs or error output (optional)