UAT: 7 of 9 /session:* TUI slash commands return "Unknown session command" — TuiCommandRouter._session_command() only handles show, export, and import #3673

Open
opened 2026-04-05 21:20:20 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/tui-session-command-router-completeness
  • Commit Message: fix(tui): implement missing session subcommands in TuiCommandRouter
  • Milestone: None (Backlog)
  • Parent Epic: #868

Background and Context

The TUI slash command system routes /session:<subcommand> tokens through TuiCommandRouter._session_command() in src/cleveragents/tui/commands.py. The spec (docs/specification.md, Session Commands table) defines 9 session subcommands that must be functional in the TUI. The current implementation only handles 3 of them, silently returning "Unknown session command: <subcommand>" for the other 6.

This was discovered during UAT testing of TUI session slash command routing completeness.

Current Behavior

TuiCommandRouter._session_command() (lines 106–113 of src/cleveragents/tui/commands.py) only handles three subcommands:

def _session_command(self, tokens, *, session_id):
    if not tokens or tokens[0] == "show":
        return f"Current session: {session_id}"
    if tokens[0] == "export":
        return self._session_export(...)
    if tokens[0] == "import":
        return self._session_import(...)
    return f"Unknown session command: {' '.join(tokens)}"

Typing /session:list in the TUI conversation panel returns "Unknown session command: list" instead of a list of sessions. The same failure occurs for create, switch, close, delete, and rename.

Additionally, the show handler only returns f"Current session: {session_id}" — a stub — rather than the full session details required by the spec (persona, actor, prompt count, cost, timestamps).

Expected Behavior

Per docs/specification.md, all 9 session subcommands must be functional in the TUI:

Subcommand Syntax Description
create /session:create [--persona <name>] Create a new session tab
list /session:list Display all sessions
show /session:show <id> Show full session details (persona, actor, prompt count, cost, timestamps)
switch /session:switch <id> Switch to session by ID or tab index
close /session:close [--force] Close the current session tab
delete /session:delete <id> [--yes/-y] Delete a saved session
rename /session:rename <name> Rename the current session
export /session:export [path] Export session to JSON
import /session:import <path> Import session from JSON

Steps to Reproduce

  1. Launch the TUI.
  2. In the conversation panel, type /session:list and press Enter.
  3. Observed: "Unknown session command: list" is displayed.
  4. Expected: A list of all sessions is displayed.

Repeat with /session:create, /session:switch <id>, /session:close, /session:delete <id>, /session:rename <name> — all return the same "Unknown session command" error.

Impact

Users cannot create new sessions, list sessions, switch between sessions, close sessions, delete sessions, or rename sessions from the TUI. Only export and import work. The show command returns an incomplete stub response.

Code Location

  • File: src/cleveragents/tui/commands.py
  • Method: TuiCommandRouter._session_command()
  • Lines: 106–113

Subtasks

  • Implement /session:create [--persona <name>] — open a new session tab, optionally binding a persona
  • Implement /session:list — render a formatted table of all sessions (ID, name, persona, prompt count, timestamps)
  • Fix /session:show <id> — return full session details: persona, actor, prompt count, cost, timestamps (not just f"Current session: {session_id}")
  • Implement /session:switch <id> — switch active tab to the given session ID or tab index
  • Implement /session:close [--force] — close the current session tab, prompting if unsaved unless --force
  • Implement /session:delete <id> [--yes/-y] — delete a saved session with confirmation guard
  • Implement /session:rename <name> — rename the current session tab
  • Add/update Behave BDD scenarios for each of the 9 session subcommands in features/tui/
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • All 9 /session:* TUI slash commands produce correct output as specified in docs/specification.md.
  • /session:show returns full session details (persona, actor, prompt count, cost, timestamps), not a stub.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

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


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

## Metadata - **Branch**: `fix/tui-session-command-router-completeness` - **Commit Message**: `fix(tui): implement missing session subcommands in TuiCommandRouter` - **Milestone**: None (Backlog) - **Parent Epic**: #868 --- ## Background and Context The TUI slash command system routes `/session:<subcommand>` tokens through `TuiCommandRouter._session_command()` in `src/cleveragents/tui/commands.py`. The spec (`docs/specification.md`, Session Commands table) defines **9 session subcommands** that must be functional in the TUI. The current implementation only handles 3 of them, silently returning `"Unknown session command: <subcommand>"` for the other 6. This was discovered during UAT testing of TUI session slash command routing completeness. ## Current Behavior `TuiCommandRouter._session_command()` (lines 106–113 of `src/cleveragents/tui/commands.py`) only handles three subcommands: ```python def _session_command(self, tokens, *, session_id): if not tokens or tokens[0] == "show": return f"Current session: {session_id}" if tokens[0] == "export": return self._session_export(...) if tokens[0] == "import": return self._session_import(...) return f"Unknown session command: {' '.join(tokens)}" ``` Typing `/session:list` in the TUI conversation panel returns `"Unknown session command: list"` instead of a list of sessions. The same failure occurs for `create`, `switch`, `close`, `delete`, and `rename`. Additionally, the `show` handler only returns `f"Current session: {session_id}"` — a stub — rather than the full session details required by the spec (persona, actor, prompt count, cost, timestamps). ## Expected Behavior Per `docs/specification.md`, all 9 session subcommands must be functional in the TUI: | Subcommand | Syntax | Description | |---|---|---| | `create` | `/session:create [--persona <name>]` | Create a new session tab | | `list` | `/session:list` | Display all sessions | | `show` | `/session:show <id>` | Show full session details (persona, actor, prompt count, cost, timestamps) | | `switch` | `/session:switch <id>` | Switch to session by ID or tab index | | `close` | `/session:close [--force]` | Close the current session tab | | `delete` | `/session:delete <id> [--yes/-y]` | Delete a saved session | | `rename` | `/session:rename <name>` | Rename the current session | | `export` | `/session:export [path]` | Export session to JSON | | `import` | `/session:import <path>` | Import session from JSON | ## Steps to Reproduce 1. Launch the TUI. 2. In the conversation panel, type `/session:list` and press Enter. 3. **Observed**: `"Unknown session command: list"` is displayed. 4. **Expected**: A list of all sessions is displayed. Repeat with `/session:create`, `/session:switch <id>`, `/session:close`, `/session:delete <id>`, `/session:rename <name>` — all return the same "Unknown session command" error. ## Impact Users cannot create new sessions, list sessions, switch between sessions, close sessions, delete sessions, or rename sessions from the TUI. Only `export` and `import` work. The `show` command returns an incomplete stub response. ## Code Location - **File**: `src/cleveragents/tui/commands.py` - **Method**: `TuiCommandRouter._session_command()` - **Lines**: 106–113 --- ## Subtasks - [ ] Implement `/session:create [--persona <name>]` — open a new session tab, optionally binding a persona - [ ] Implement `/session:list` — render a formatted table of all sessions (ID, name, persona, prompt count, timestamps) - [ ] Fix `/session:show <id>` — return full session details: persona, actor, prompt count, cost, timestamps (not just `f"Current session: {session_id}"`) - [ ] Implement `/session:switch <id>` — switch active tab to the given session ID or tab index - [ ] Implement `/session:close [--force]` — close the current session tab, prompting if unsaved unless `--force` - [ ] Implement `/session:delete <id> [--yes/-y]` — delete a saved session with confirmation guard - [ ] Implement `/session:rename <name>` — rename the current session tab - [ ] Add/update Behave BDD scenarios for each of the 9 session subcommands in `features/tui/` - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - All 9 `/session:*` TUI slash commands produce correct output as specified in `docs/specification.md`. - `/session:show` returns full session details (persona, actor, prompt count, cost, timestamps), not a stub. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.7.0 milestone 2026-04-05 21:24:40 +00:00
freemo removed this from the v3.7.0 milestone 2026-04-06 23:31:37 +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
Reference
cleveragents/cleveragents-core#3673
No description provided.