-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
ACP clients (e.g. Zed) display a "Recent" panel listing previous sessions and allow users to resume them. Zeph currently stores ACP session events in SQLite (acp_sessions + acp_session_events tables via SqliteStore) but exposes no API surface to list or resume past sessions. Clients have no way to query history and render the panel.
Solution
1. ACP transport — new endpoints
Implement two new HTTP/WS endpoints in zeph-acp transport layer:
GET /sessions— returns a paginated list of sessions with metadata:[ { "id": "...", "title": "...", "created_at": "...", "updated_at": "...", "message_count": 5 } ]GET /sessions/{session_id}/messages— returns the full event log for a session so the client can replay it.
2. ACP agent — resume protocol
When a client sends POST /runs (or opens a WS) with an existing session_id, the agent must:
- Load stored events from
SqliteStore::load_acp_events. - Reconstruct conversation context and inject it into the
ContextBuilderbefore the first LLM call. - Continue appending new events to the same session row.
Currently SqliteStore::create_acp_session uses INSERT OR IGNORE, so re-using an existing ID is safe — but the agent loop does not yet load prior context on resume.
3. Session title inference
After the first assistant turn, auto-generate a short title (first ~60 chars of the first user message, or a one-shot summarisation call) and persist it via SqliteStore::update_session_title.
4. TUI — session browser panel
Add a collapsible session history panel (keybind: H) to zeph-tui:
- List recent sessions with truncated title + relative timestamp.
Enterswitches the active session, loading its context.Ddeletes a session (with confirmation prompt).
5. Config
Add [memory.sessions] section to config.toml:
[memory.sessions]
max_history = 100 # sessions to keep; 0 = unlimited
title_max_chars = 606. CLI
zeph sessions list # print sessions table
zeph sessions resume <id> # open existing session in interactive mode
zeph sessions delete <id> # remove session and events
Affected crates
| Crate | Change |
|---|---|
zeph-acp |
new HTTP handlers, resume logic in agent loop |
zeph-memory |
list_acp_sessions already exists; add updated_at + message_count columns |
zeph-tui |
new session browser panel |
zeph-core / src/main.rs |
CLI subcommands, config struct |
Acceptance criteria
-
GET /sessionsreturns sessions ordered byupdated_at DESC. - Client sending an existing
session_idreceives conversation context from previous turns. - Session title is auto-populated after the first assistant reply.
- TUI shows recent sessions and allows switching.
-
zeph sessions listprints a table with ID, title, date. - Unit tests cover resume context reconstruction and title inference.
References
- Zed ACP panel screenshot: shows "Recent" list with timestamps and "View All" shortcut.
- Existing storage:
crates/zeph-memory/src/sqlite/acp_sessions.rs. - ACP spec: https://agentclientprotocol.com/get-started/introduction