Overview
Sessions represent ACP (Agent Communication Protocol) conversations between users and agents. Each session maintains context, history, and state for ongoing interactions.List Sessions
Endpoint
List all ACP sessions
Query Parameters
Filter sessions by workspace ID
Response
Array of session objects
Session Object
The exact structure depends on the ACP implementation, but typically includes:Unique session identifier
Optional session name or title
Associated workspace ID
ISO 8601 timestamp of session creation
ISO 8601 timestamp of last activity
Session status (e.g., “active”, “idle”, “closed”)
Response Example
Session Lifecycle
Sessions are created and managed through the ACP JSON-RPC endpoint at/api/acp. The sessions endpoint provides read-only access for monitoring and display purposes.
Creating Sessions
To create a new session, use the ACP JSON-RPC endpoint:Managing Sessions
Other session operations (prompts, mode changes, cancellation) are handled through the ACP endpoint. See the ACP documentation for details.Session Persistence
Sessions are persisted in the database and automatically hydrated when accessed:- Next.js Backend: Sessions stored in Postgres/SQLite
- Rust Backend: Sessions stored in SQLite
First Access
On the first call to/api/sessions, the session store hydrates from the database, loading all persisted sessions into memory.
Filtering Sessions
By Workspace
Cache Control
The sessions endpoint includesCache-Control: no-store headers to ensure fresh data is always returned.
Related Endpoints
ACP JSON-RPC
For full session management capabilities, use the ACP endpoint:- POST /api/acp - JSON-RPC methods for session creation, prompts, and control
- GET /api/acp?sessionId= - SSE stream for real-time session events
Notes by Session
To retrieve notes associated with a session:Tasks by Session
To retrieve tasks associated with a session:Session Context
Each session maintains:- Conversation History: Messages exchanged between user and agent
- Context: Current working directory, active files, and state
- Mode: Interaction mode (e.g., chat, autonomous, review)
- Workspace: Associated workspace and codebases
Use Cases
List Active Sessions
Display Session History
Monitor Session Activity
Implementation
The sessions endpoint is implemented in:- Next.js:
src/app/api/sessions/route.ts - Rust:
crates/routa-server/src/routes/sessions.rs
Error Responses
The endpoint returns standard HTTP status codes:| Status Code | Description |
|---|---|
200 | Success |
500 | Server error (e.g., database connection failed) |