Skip to content

bug(launcher): on exit, gentle-shell suggests pi --session <id>, which cannot find the session #1503

Description

@matraket

Before submitting

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

  1. Resume message does not include PI_CODING_AGENT_DIR override earendil-works/pi#8048 (0.84.1, 2026-08-12): proposes including PI_CODING_AGENT_DIR in 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.
  2. InteractiveMode SDK option for application-specific resume commands earendil-works/pi#9750 and its PR Allow SDK callers to customize the interactive resume command earendil-works/pi#9749 (2026-09-18): propose an InteractiveModeOptions.formatResumeCommand option 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 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

  1. Start gentle-shell in isolated mode (the default, without --link).
  2. Send a prompt and wait for the answer, so the session is saved.
  3. Quit with /quit or Ctrl+D.
  4. Pi prints To resume this session: pi --session <id>.
  5. 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'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:approvedIssue approved by maintainer; PR may be opened

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions