UAT: agents session list and agents session delete show hardcoded "0 KB" storage — spec requires actual storage calculation #3506

Open
opened 2026-04-05 18:42:51 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/session-storage-calculation
  • Commit Message: fix(cli): implement actual storage calculation for session list and delete commands
  • Milestone: None (Backlog)
  • Parent Epic: #397

Backlog note: This issue was discovered during autonomous operation
on milestone v3.5.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Background and Context

Code-level analysis of src/cleveragents/cli/commands/session.py against docs/specification.md §"agents session list" (lines 1594–1650) and §"agents session delete" (lines 1873–1985).

Both agents session list and agents session delete display hardcoded "0 KB" for storage fields. The specification requires actual storage values (e.g., "42 KB" for list summary, "18 KB freed" for delete). The code even has a comment acknowledging this is a placeholder.

Current Behavior (Actual)

In agents session list (session.py lines 157, 341):

"storage": "0 KB",  # Placeholder - actual storage calculation not implemented
summary_table.add_row("Storage:", "0 KB")  # Placeholder

In agents session delete (session.py line 507):

summary_table.add_row("Storage:", "0 KB freed")

Expected Behavior (from spec)

agents session list Summary panel (spec line 1624):

│ Storage: 42 KB               │

agents session delete Deletion Summary panel (spec line 1898):

│ Storage: 18 KB freed         │

The storage values should reflect the actual disk space used by the session's messages and metadata in the database.

Code Location

  • src/cleveragents/cli/commands/session.py:
    • Line 157: "storage": "0 KB", # Placeholder
    • Line 341: summary_table.add_row("Storage:", "0 KB")
    • Line 507: summary_table.add_row("Storage:", "0 KB freed")

Steps to Reproduce

  1. Create a session with messages: agents session create && agents session tell --session <ID> "Hello"
  2. Run: agents session list
  3. Observe: Summary panel shows Storage: 0 KB instead of actual storage

Subtasks

  • Implement storage calculation in SessionRepository or SessionService — estimate bytes used by session messages and metadata
  • Update _session_list_dict() to use actual storage value
  • Update list_sessions() Rich output to use actual storage value
  • Update delete() Rich output to show actual bytes freed
  • Add Behave scenarios for storage calculation
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97%

Definition of Done

  • agents session list Summary panel shows actual storage (e.g., "42 KB") instead of "0 KB"
  • agents session delete Deletion Summary panel shows actual storage freed (e.g., "18 KB freed") instead of "0 KB freed"
  • All Behave scenarios pass
  • nox passes with coverage >= 97%
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/session-storage-calculation` - **Commit Message**: `fix(cli): implement actual storage calculation for session list and delete commands` - **Milestone**: None (Backlog) - **Parent Epic**: #397 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.5.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context Code-level analysis of `src/cleveragents/cli/commands/session.py` against `docs/specification.md` §"agents session list" (lines 1594–1650) and §"agents session delete" (lines 1873–1985). Both `agents session list` and `agents session delete` display hardcoded "0 KB" for storage fields. The specification requires actual storage values (e.g., "42 KB" for list summary, "18 KB freed" for delete). The code even has a comment acknowledging this is a placeholder. ## Current Behavior (Actual) **In `agents session list`** (`session.py` lines 157, 341): ```python "storage": "0 KB", # Placeholder - actual storage calculation not implemented ``` ```python summary_table.add_row("Storage:", "0 KB") # Placeholder ``` **In `agents session delete`** (`session.py` line 507): ```python summary_table.add_row("Storage:", "0 KB freed") ``` ## Expected Behavior (from spec) **`agents session list` Summary panel** (spec line 1624): ``` │ Storage: 42 KB │ ``` **`agents session delete` Deletion Summary panel** (spec line 1898): ``` │ Storage: 18 KB freed │ ``` The storage values should reflect the actual disk space used by the session's messages and metadata in the database. ## Code Location - `src/cleveragents/cli/commands/session.py`: - Line 157: `"storage": "0 KB", # Placeholder` - Line 341: `summary_table.add_row("Storage:", "0 KB")` - Line 507: `summary_table.add_row("Storage:", "0 KB freed")` ## Steps to Reproduce 1. Create a session with messages: `agents session create && agents session tell --session <ID> "Hello"` 2. Run: `agents session list` 3. Observe: Summary panel shows `Storage: 0 KB` instead of actual storage ## Subtasks - [ ] Implement storage calculation in `SessionRepository` or `SessionService` — estimate bytes used by session messages and metadata - [ ] Update `_session_list_dict()` to use actual storage value - [ ] Update `list_sessions()` Rich output to use actual storage value - [ ] Update `delete()` Rich output to show actual bytes freed - [ ] Add Behave scenarios for storage calculation - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% ## Definition of Done - [ ] `agents session list` Summary panel shows actual storage (e.g., "42 KB") instead of "0 KB" - [ ] `agents session delete` Deletion Summary panel shows actual storage freed (e.g., "18 KB freed") instead of "0 KB freed" - [ ] All Behave scenarios pass - [ ] `nox` passes with coverage >= 97% - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.7.0 milestone 2026-04-05 20:36:08 +00:00
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.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3506
No description provided.