- Author(s): @ahmedhesham6
- Champion: @benbrandt
Elevator pitch
Add asession/list endpoint to the ACP protocol that allows clients to query and enumerate existing sessions from an agent, enabling session management features like session history, session switching, and session cleanup.
Status quo
Currently, the ACP protocol provides session management throughsession/new and session/load endpoints. However, there is no way for clients to:
- Discover existing sessions - Clients cannot query what sessions exist on an agent
- Display session history - Users cannot see a list of their past conversations
- Manage multiple sessions - Switching between sessions requires clients to track session IDs themselves
- Clean up old sessions - No way to discover stale or abandoned sessions for cleanup
- Poor user experience - Users cannot browse their conversation history or resume previous sessions easily
- Client-side complexity - Each client must implement its own session tracking and persistence
- Inconsistent behavior - Different clients handle session management differently, leading to fragmented experiences
- Requires persistent storage on the client side
- Can get out of sync if sessions are created/destroyed outside the client
- Doesn’t work across different client instances or devices
- Cannot leverage agent-side session metadata or state
What we propose to do about it
Add a newsession/list JSON-RPC method to the protocol that returns metadata about sessions known to the agent. This endpoint would:
-
Return a list of sessions with essential metadata:
sessionId- Unique identifiercreatedAt- Timestamp when session was createdupdatedAt- Timestamp of last update to the sessioncwd- Working directory for the sessiontitle- Optional human-readable title (could be auto-generated from first prompt)_meta- Optional agent-specific metadata
-
Support filtering and pagination:
- Filter by creation date, last accessed date, or working directory
- Limit the number of results returned
- Search by title or agent-provided metadata
-
Be an optional capability:
- Agents advertise
listSessions: truein initialization if they support this feature - Clients check for this capability before attempting to call
session/list - Agents without persistent session storage don’t need to implement this
- Agents advertise
JSON-RPC Request
The client callssession/list with optional filtering and pagination parameters:
Request Parameters
All parameters are optional:cwd(string) - Filter sessions by working directorycreatedAfter(string) - ISO 8601 timestamp, only return sessions created after this timecreatedBefore(string) - ISO 8601 timestamp, only return sessions created before this timeupdatedAfter(string) - ISO 8601 timestamp, only return sessions updated after this timelimit(number) - Maximum number of results to return (default: 50, max: 1000)cursor(string) - Opaque cursor token from a previous response’snextCursorfield for cursor-based paginationsearch(string) - Free-text search across titles or agent metadata
Minimal Request Example
A request with no filters returns all sessions with default sorting:JSON-RPC Response
The agent responds with a list of sessions and cursor pagination metadata:Response Fields
Response object:sessions(array) - Array of session information objectsnextCursor(string, optional) - Opaque cursor token. If present, pass this in the next request’scursorparameter to fetch the next page. If absent, there are no more results.
sessionId(string, required) - Unique identifier for the sessioncreatedAt(string, required) - ISO 8601 timestamp when session was createdupdatedAt(string, required) - ISO 8601 timestamp of last activitycwd(string, required) - Working directory for the sessiontitle(string, optional) - Human-readable title (may be auto-generated from first prompt)_meta(object, optional) - Agent-specific metadata (e.g., message count, error status, tags)
Empty Result Example
When no sessions match the criteria:Shiny future
Once this feature exists:- Clients can build session browsers - Users can view a list of all their conversations, sorted by recency or relevance
- Session switching becomes seamless - Users can easily switch between ongoing conversations
- Better resource management - Clients can identify and clean up old or inactive sessions
- Cross-device continuity - Users could potentially access their sessions from different devices (if agent supports it)
- Improved UX patterns:
- “Recent conversations” sidebar
- Search through past sessions
- Archive/delete old sessions
- Resume interrupted work easily
- Better visibility into active sessions
- Opportunity to implement session lifecycle policies
- Foundation for future features like session sharing or collaboration
Implementation details and plan
Phase 1: Core Protocol Changes
-
Update schema.json to add:
session/listmethod definitionListSessionsRequestandListSessionsResponsetypesSessionInfotypelistSessionscapability flag
-
Update protocol documentation in
/docs/protocol/session-setup.mdx:- Document the new endpoint
- Explain when to use it vs. maintaining client-side session tracking
- Provide examples of common use cases
Phase 2: Reference Implementation
-
Implement in Rust SDK (
rust/agent.rsandrust/client.rs):- Add
list_sessionsmethod to agent trait - Provide default implementation (empty list) for agents without persistence
- Add client method to call
session/list
- Add
-
Add to TypeScript SDKs (if applicable):
- Update TypeScript types
- Add client methods
Phase 3: Example Implementation
- Create example agent that demonstrates:
- In-memory session registry
- Automatic title generation from first prompt
- Session lifecycle management (cleanup after N days)
- Pagination and filtering
Compatibility Considerations
- Backward compatible: Existing agents continue working without implementing this
- Capability-based: Clients check for
listSessionscapability before using - No breaking changes: No modifications to existing endpoints
Security Considerations
- Session isolation: Agents must ensure sessions are only listed for the authenticated client
- Resource limits: Agents should enforce reasonable limits on pagination to prevent abuse
Frequently asked questions
What alternative approaches did you consider, and why did you settle on this one?
Several alternatives were considered:-
Client-side session tracking only - This is the current approach, but it has limitations:
- Doesn’t work across devices
- Can get out of sync
- Adds complexity to every client implementation
-
Session events/notifications - Push notifications when sessions are created/destroyed:
- More complex to implement
- Requires long-lived connections
- Still requires client-side state management
- Better suited as a future enhancement, not a replacement
-
File-based session manifest - Agent writes session list to a file that clients read:
- Couples agent and client file system access
- Doesn’t work for remote agents
- No standard format
- Consistent with existing protocol design - Uses same RPC patterns as other endpoints
- Flexible - Supports filtering, pagination, and agent-specific metadata
- Optional - Agents can opt-in based on their architecture
- Simple - Single request/response pattern, easy to implement and use
Why not make this mandatory for all agents?
Many agents may not have persistent storage or multi-session capabilities. Making this optional:- Allows simple, stateless agents to remain compliant
- Reduces implementation burden
- Lets agents evolve session management over time
How does this interact with session/load?
session/load remains the mechanism to actually restore a session. session/list is for discovery only:
- Client calls
session/listto get available sessions - User selects a session
- Client calls
session/loadwith the chosensessionId
session/list without supporting session/load (e.g., for read-only session browsing).
Should we include session content in the list response?
No, for several reasons:- Performance - Full conversation history could be large
- Privacy - Listing sessions might be less sensitive than exposing full content
- Separation of concerns - Use
session/loadto get full session content
What about session deletion?
Session deletion is intentionally left out of this RFD to keep scope focused. A futuresession/delete endpoint could be proposed separately. For now, agents can implement their own lifecycle policies.
How should pagination work for large session lists?
We use cursor-based pagination:- Request includes
limitand optionalcursor - Response includes
nextCursorwhen more results are available - Clients should treat a missing
nextCursoras the end of results - Clients MUST treat cursors as opaque tokens: don’t parse, modify, or persist them across sessions
- The cursor MUST be a string; never send a raw JSON object as the cursor
- Servers SHOULD provide stable cursors and handle invalid cursors gracefully
Revision history
- 2025-10-29: Initial draft proposal
- 2025-10-30: Update to use
_metafield for agent-specific metadata - 2025-10-30: Switch from offset-based to cursor-based pagination using continuation tokens
- 2025-10-30: Rename
lastAccessedAttoupdatedAtfor consistency - 2025-10-30: Remove
previewfield from SessionInfo (out of scope) - 2025-10-30: Remove session orphaning from problem statement
- 2025-10-30: Replace
sortBy/sortOrderwithsearchparameter; removetotalcount from response - 2025-10-31: Update pagination:
continuationToken→cursor,nextContinuationToken→nextCursor, removehasMore