feat(acp): session history — list and resume past conversations#1012
Merged
feat(acp): session history — list and resume past conversations#1012
Conversation
aeca7df to
acda96f
Compare
e7877ad to
090d0e1
Compare
Closes #1004 Expose persisted ACP session history to clients via REST endpoints, resume-by-session-id protocol, CLI subcommands, TUI panel, and config. - GET /sessions: returns persisted sessions ordered by updated_at DESC, bounded by memory.sessions.max_history (default 100) - GET /sessions/{id}/messages: returns full event log with created_at; validates session_id as UUID, returns 400 on invalid input - Resume: sending an existing session_id to new_session reconstructs conversation context from SQLite before the first LLM turn - Session title: auto-inferred from first user message (title_max_chars=60) after first assistant reply; forwarded in list_sessions responses - Migration 017: updated_at trigger fires on every acp_session_events insert - AcpSessionInfo enriched with title, updated_at, message_count fields - max_history wired through AcpServerConfig, ZephAcpAgent, HTTP handler, and agent list_sessions (previously hardcoded 0) - zeph-core::text::truncate_to_chars: Unicode-aware helper replacing duplicated truncation logic in agent and CLI - [memory.sessions] config section with max_history and title_max_chars - sessions list/resume/delete CLI subcommands (acp feature gate) - TUI session browser panel: H keybind, session:history command palette entry - tracing::warn! on startup when auth_bearer_token is None (HTTP transport) - --init wizard prompts for max_history and title_max_chars - SessionEventDto.created_at field for event timestamps in REST response
8b05115 to
ff35dc8
Compare
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.
Closes #1004
Summary
GET /sessionslists persisted sessions (title, timestamps, message count) ordered byupdated_at DESC, bounded bymemory.sessions.max_historyGET /sessions/{id}/messagesreturns the full event log withcreated_atper event; validatessession_idas UUID (400 on invalid)session_idvianew_sessionreconstructs conversation context from SQLite before the first LLM turntitle_max_chars=60chars) after first assistant reply; forwarded inlist_sessionsresponses017:updated_attrigger fires on everyacp_session_eventsinsertmax_historywired throughAcpServerConfig,ZephAcpAgent, HTTP handler, and agentlist_sessions(previously hardcoded to 0)zeph-core::text::truncate_to_chars: Unicode-aware helper replacing duplicated truncation in agent and CLI[memory.sessions]config section (max_history,title_max_chars) inMemoryConfigandconfig/default.tomlsessions list/resume/deleteCLI subcommands (behindacpfeature gate)Hkeybind andsession:historycommand palette entry for session browser paneltracing::warn!on startup whenauth_bearer_tokenis None (HTTP transport)--initwizard prompts formax_historyandtitle_max_charsSessionEventDto.created_atfield in REST responseTest plan
cargo nextest run --workspace --lib --bins— 2954/2954 passGET /sessionsandGET /sessions/{id}/messages— 503/400/404/200 caseslist_acp_sessionsunit tests: trigger, limit, message count, title, boundarylimit=1truncate_to_charstests inzeph-core::text(no feature gate)cargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— clean