Skip to content

[Feature]: ACP: resume sessions: choose a session and show its history #145

Done

Description

@TeseySTD

Part of #144

#151 adds snapshot/recap handoffs and the compatible /acp-agent command spelling. The session chooser and earlier-history replay described below remain outstanding.

Problem

  1. /agent-acp <name> --resume continues the agent's previous session and the agent keeps its context, but the pane shows none of the earlier messages, so the user can't see what was discussed or done.
  2. --resume always resumes the last stored session for the folder. After starting a new conversation (or /clear) the older sessions still exist in the agent, but the user can't pick one.

Cause

  • The resume path uses session/resume, which does not replay history. The Claude adapter (@agentclientprotocol/claude-agent-acp 0.103.0) advertises loadSession: true, and session/load replays the conversation as session/update notifications.
  • Only the last session id per folder is stored; the agent's own list (session/list) isn't used for selection.

Proposal

History

  • Prefer session/load when the agent advertises loadSession; fall back to session/resume (with the current "earlier messages are not shown here" message) otherwise.
  • Render replayed user turns (user_message_chunk), agent text, completed tool calls and plans. No permission prompts during replay.
  • Replay must not count as an active turn (HasActiveWork) and must not be re-sent to the agent; prompts typed during replay are queued.
  • Mark the replayed part with separator lines; cap the rendered part for long histories (last N turns) and keep the UI responsive.

Choosing a session

  • --resume without an id: ask the agent for its sessions for the current folder (session/list, follow the cursor, cap the number shown). One session: resume it directly. Several: show a selection list (title or first prompt, last-updated time, shortened id); Esc cancels without changing the pane.
  • --resume <id>: resume that session directly (works with --new-panel). The id is treated as an opaque string, validated, and never placed into a shell command.
  • If the agent doesn't advertise session/list, keep using the stored last-session id and say that choosing isn't supported by this agent.
  • /agent-acp sessions stays a plain list and shows the full id. Update the stored last-session id after a resume, after /clear and after a new session.

Acceptance criteria

  • Resuming with the Claude adapter shows the earlier conversation in the pane; agents without loadSession keep today's behavior and message.
  • Picker result, direct id, single session, no list support and cancel are covered by tests (mock agent with several sessions and a load/replay scenario).
  • README.md ACP guidance updated (the standalone docs/acp.md guide was retired).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions