UAT: TUI session persistence not implemented — sessions not saved to SQLite tui.db on exit #5045

Closed
opened 2026-04-09 00:50:43 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: TUI — Session Persistence and Resume

Severity: High (session resume impossible)

What Was Tested

TUI session persistence as defined in the specification (§ Session Persistence and Resume).

Expected Behavior (from spec)

TUI sessions are persisted to an SQLite database at ~/.local/state/cleveragents/tui.db with the following schema:

Column Type Description
id TEXT (PK) UUID matching the domain Session entity ID
persona_name TEXT Name of the persona active when last used
actor_identity TEXT Namespaced actor identity
title TEXT User-assigned or auto-generated session title
prompt_count INTEGER Number of user prompts sent
total_cost REAL Cumulative cost in USD
created_at TEXT (ISO 8601) Session creation timestamp
last_used TEXT (ISO 8601) Last interaction timestamp
project_path TEXT Working directory at session creation
meta_json TEXT JSON blob for extensible metadata

Resume workflow:

  1. User presses ctrl+r from SessionsScreen
  2. TUI reads session record from SQLite
  3. New A2A Task initiated with stored session ID
  4. Actor receives conversation history via A2A multi-turn pattern
  5. Conversation stream populated with historical messages
  6. Persona restored to stored persona

Actual Behavior (from code analysis)

No SQLite persistence for TUI sessions exists anywhere in the codebase. The tui.db file is not created. The SessionView dataclass in src/cleveragents/tui/app.py (lines 56-60) only holds session_id and transcript: list[str] in memory.

The TuiCommandRouter._session_export() method (lines 115-196 of commands.py) delegates to the domain session_service for export, but there is no TUI-specific session persistence layer.

No tui.db schema migration or initialization code exists.

Steps to Reproduce

  1. Run agents tui
  2. Have a conversation
  3. Quit with ctrl+q
  4. Run agents tui again
  5. Observe: previous conversation is gone, no saved sessions appear

Code Location

  • src/cleveragents/tui/app.py lines 56-60 (in-memory SessionView only)
  • No tui.db initialization code exists in the TUI module

Impact

Users cannot resume previous TUI sessions. Every TUI launch starts fresh with no conversation history. The Sessions Screen (when implemented) will have no saved sessions to display.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area:** TUI — Session Persistence and Resume **Severity:** High (session resume impossible) ### What Was Tested TUI session persistence as defined in the specification (§ Session Persistence and Resume). ### Expected Behavior (from spec) TUI sessions are persisted to an SQLite database at `~/.local/state/cleveragents/tui.db` with the following schema: | Column | Type | Description | |--------|------|-------------| | `id` | TEXT (PK) | UUID matching the domain Session entity ID | | `persona_name` | TEXT | Name of the persona active when last used | | `actor_identity` | TEXT | Namespaced actor identity | | `title` | TEXT | User-assigned or auto-generated session title | | `prompt_count` | INTEGER | Number of user prompts sent | | `total_cost` | REAL | Cumulative cost in USD | | `created_at` | TEXT (ISO 8601) | Session creation timestamp | | `last_used` | TEXT (ISO 8601) | Last interaction timestamp | | `project_path` | TEXT | Working directory at session creation | | `meta_json` | TEXT | JSON blob for extensible metadata | Resume workflow: 1. User presses `ctrl+r` from SessionsScreen 2. TUI reads session record from SQLite 3. New A2A Task initiated with stored session ID 4. Actor receives conversation history via A2A multi-turn pattern 5. Conversation stream populated with historical messages 6. Persona restored to stored persona ### Actual Behavior (from code analysis) No SQLite persistence for TUI sessions exists anywhere in the codebase. The `tui.db` file is not created. The `SessionView` dataclass in `src/cleveragents/tui/app.py` (lines 56-60) only holds `session_id` and `transcript: list[str]` in memory. The `TuiCommandRouter._session_export()` method (lines 115-196 of `commands.py`) delegates to the domain `session_service` for export, but there is no TUI-specific session persistence layer. No `tui.db` schema migration or initialization code exists. ### Steps to Reproduce 1. Run `agents tui` 2. Have a conversation 3. Quit with `ctrl+q` 4. Run `agents tui` again 5. Observe: previous conversation is gone, no saved sessions appear ### Code Location - `src/cleveragents/tui/app.py` lines 56-60 (in-memory SessionView only) - No `tui.db` initialization code exists in the TUI module ### Impact Users cannot resume previous TUI sessions. Every TUI launch starts fresh with no conversation history. The Sessions Screen (when implemented) will have no saved sessions to display. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Closing as duplicate of #4739 — both issues report the same problem: TUI SQLite session persistence not implemented.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Closing as duplicate of #4739 — both issues report the same problem: TUI SQLite session persistence not implemented. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5045
No description provided.