Skip to content

feat(acp): session history — list and resume past conversations#1012

Merged
bug-ops merged 5 commits intomainfrom
worktree-issue-1004-session-history
Feb 27, 2026
Merged

feat(acp): session history — list and resume past conversations#1012
bug-ops merged 5 commits intomainfrom
worktree-issue-1004-session-history

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 27, 2026

Closes #1004

Summary

  • GET /sessions lists persisted sessions (title, timestamps, message count) ordered by updated_at DESC, bounded by memory.sessions.max_history
  • GET /sessions/{id}/messages returns the full event log with created_at per event; validates session_id as UUID (400 on invalid)
  • Resume protocol: sending an existing session_id via new_session reconstructs conversation context from SQLite before the first LLM turn
  • Session title auto-inferred from first user message (max title_max_chars=60 chars) after first assistant reply; forwarded in list_sessions responses
  • Migration 017: updated_at trigger fires on every acp_session_events insert
  • max_history wired through AcpServerConfig, ZephAcpAgent, HTTP handler, and agent list_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) in MemoryConfig and config/default.toml
  • sessions list/resume/delete CLI subcommands (behind acp feature gate)
  • TUI: H keybind and session:history command palette entry for session browser panel
  • 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 in REST response

Test plan

  • cargo nextest run --workspace --lib --bins — 2954/2954 pass
  • HTTP handler tests: GET /sessions and GET /sessions/{id}/messages — 503/400/404/200 cases
  • list_acp_sessions unit tests: trigger, limit, message count, title, boundary limit=1
  • truncate_to_chars tests in zeph-core::text (no feature gate)
  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean

@github-actions github-actions bot added enhancement New feature or request documentation Improvements or additions to documentation memory Persistence and memory rust size/XL core config and removed enhancement New feature or request labels Feb 27, 2026
@bug-ops bug-ops force-pushed the worktree-issue-1004-session-history branch from aeca7df to acda96f Compare February 27, 2026 01:50
@github-actions github-actions bot added the enhancement New feature or request label Feb 27, 2026
@bug-ops bug-ops force-pushed the worktree-issue-1004-session-history branch from e7877ad to 090d0e1 Compare February 27, 2026 02:13
@bug-ops bug-ops enabled auto-merge (squash) February 27, 2026 02:15
@bug-ops bug-ops disabled auto-merge February 27, 2026 02:45
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
@bug-ops bug-ops force-pushed the worktree-issue-1004-session-history branch from 8b05115 to ff35dc8 Compare February 27, 2026 02:51
@bug-ops bug-ops enabled auto-merge (squash) February 27, 2026 02:57
@bug-ops bug-ops merged commit ab01112 into main Feb 27, 2026
28 checks passed
@bug-ops bug-ops deleted the worktree-issue-1004-session-history branch February 27, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config core documentation Improvements or additions to documentation enhancement New feature or request memory Persistence and memory rust size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(acp): session history — list and resume past conversations

1 participant