feat(acp): add persisted session list and load support - #1116
Open
giuliastro wants to merge 4 commits into
Open
Conversation
giuliastro
marked this pull request as ready for review
August 10, 2026 06:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add standard ACP persisted-session discovery and loading to Prime Agent.
sessionCapabilities.listandloadSessionsession/listover the existingAgentConnection.listSavedSessions()registrycwdfiltering and opaque cursor paginationsession/loadviaAgentConnection.switchSession()session/updatechunksMotivation
ACP
session/listis now stable and gives clients a standard way to discover agent-owned persisted sessions. Prime Agent already exposes the required saved-session primitives internally (listSavedSessionsandswitchSession), so supporting this at the ACP boundary avoids client-specific session registries and adapters.This is useful for editors, remote clients and other ACP consumers that want to browse and reopen Prime Agent sessions without depending on Prime-specific filesystem knowledge.
Behavior
session/listreturns persisted Prime Agent session IDs, cwd, title and modification timestamp. Results are filtered bycwdwhen supplied and paginated with an opaque cursor.session/loadresolves the ACPsessionIdthrough Prime Agent's saved-session registry, switches the underlyingAgentConnection, subscribes to live updates, and replays persisted user/assistant text before returning.The ACP process still hosts only one active session at a time. Clients must
session/closebefore creating or loading another session on the same connection.Tests
Added
acp-sessions.test.tscovering persisted-session listing/filtering and load/history replay.Note
Add
session/listandsession/loadsupport to ACP modesession/listhandler that returns persisted sessions with optional cwd filtering and cursor-based pagination (page size 50).session/loadhandler that switches to a saved session by ID and replays prior user/assistant text messages assession/updatenotifications before returning.session/neworsession/loadis refused while a session is active.initializeresponse now advertisesloadSession: trueand thelistsession capability.session/load.Macroscope summarized c172efb.