Skip to content

ACP: /session delete, cleanup and prune fail with "sessionsApi ... is unavailable for this session" #5268

Closed

Description

@miriver

Describe the bug

In ACP mode (copilot --acp --stdio), Copilot advertises /session in available_commands_update, but its delete, cleanup and prune subcommands fail over ACP. Sent as a session/prompt, each ends with end_turn in about 1 ms, without a model call, and replies with an error:

Prompt Reply
/session delete <id> Failed to run /session: Error: slash command effect sessionsApi.list is unavailable for this session
/session cleanup Failed to run /session: Error: slash command effect sessionsApi.list is unavailable for this session
/session prune --older-than 1 --dry-run --include-named Failed to run /session: Error: slash command effect sessionsApi.pruneOld is unavailable for this session

Nothing is deleted: the sessions' folders stay in session-state.

An ACP client has no other way to delete Copilot sessions. initialize offers sessionCapabilities list and close only, without ACP's stable session/delete.

Affected version

GitHub Copilot CLI 1.0.104

Steps to reproduce the behavior

  1. Start copilot --acp --stdio and initialize.
  2. Call session/new twice, for sessions A and B.
  3. Send session A a session/prompt with the text /session delete <B's sessionId>.
  4. The reply is the sessionsApi.list error above, with stopReason: end_turn. Session B's folder is still in session-state.
  5. Send /session cleanup, then /session prune --older-than 1 --dry-run --include-named. Each gets its error above.

Expected behavior

These subcommands work over ACP as they do in the interactive CLI:

  • /session delete <id> deletes the session.
  • /session cleanup removes empty or abandoned sessions.
  • /session prune --older-than <days> deletes old sessions, or lists them with --dry-run.

Each replies with what it did.

Better still for ACP clients: advertise sessionCapabilities.delete and support session/delete. Then a client can delete a session without sending a prompt through another one.

Additional context

Activity

  1. added
    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation
    area:sessionsSession management, resume, history, session picker, and session state
    and removed on Oct 28, 2026
  2. devm33 commented on Nov 3, 2026

    @devm33
    Member

    This should be fixed in Copilot CLI 1.0.106-1, the first public release containing the fix: https://github.com/github/copilot-cli/releases/tag/v1.0.106-1 (prerelease, published October 31, 2026).

    Verified against that published build over ACP stdio with an isolated profile: /session cleanup and /session prune --older-than 1 --dry-run --include-named complete without the unavailable-effect errors, and /session delete <id> --yes successfully deletes a saved test session and removes its session directory. This fixes the reported slash-command failures; it does not add the separate session/delete protocol method.

    Closing as fixed. Please reopen if the slash-command failures persist on this version or newer.

    Generated by Copilot

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

    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automationarea:sessionsSession management, resume, history, session picker, and session state

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions