UAT: TUI /session slash command handler missing create, list, switch, close, delete, and rename subcommands #3808

Open
opened 2026-04-06 06:29:54 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/tui-session-slash-command-subcommands
  • Commit Message: fix(tui): implement missing session slash command subcommands in TuiCommandRouter
  • Milestone: (backlog — no milestone assigned)
  • Parent Epic: #868

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.

Background and Context

The TuiCommandRouter._session_command() method in src/cleveragents/tui/commands.py only handles three session subcommands (show, export, import). The specification defines six additional session slash commands that are unimplemented, causing them to silently return an error string instead of performing any action.

This is a sub-issue of the broader TUI slash command router gap (issue #3803). Even if the router is fixed to properly dispatch colon-namespaced commands, the session handler itself needs these subcommands implemented.

Current Behavior

_session_command() (lines 69–76 of commands.py) only handles:

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)}"

The following subcommands return "Unknown session command: <tokens>":

  • create → "Unknown session command: create"
  • list → "Unknown session command: list"
  • switch <id> → "Unknown session command: switch "
  • close → "Unknown session command: close"
  • delete <id> → "Unknown session command: delete "
  • rename <name> → "Unknown session command: rename "

Additionally, the show implementation only returns f"Current session: {session_id}" — it does not display the full session details (messages, linked plans, token usage) as specified.

Steps to reproduce:

  1. Launch the TUI: agents tui
  2. Type /session:create → returns "Unknown session command: create"
  3. Type /session:list → returns "Unknown session command: list"
  4. Type /session:switch <id> → returns "Unknown session command: switch "
  5. Type /session:close → returns "Unknown session command: close"
  6. Type /session:delete <id> → returns "Unknown session command: delete "
  7. Type /session:rename myname → returns "Unknown session command: rename myname"

Code location: src/cleveragents/tui/commands.py_session_command() method (lines 69–76)

Expected Behavior

Per specification §TUI Slash Command Overlay (lines 29274–29280), the following session slash commands should be fully functional:

Command Description
/session:create [--persona <name>] Create a new session tab
/session:list Display all sessions
/session:show Show full session details (messages, linked plans, token usage)
/session:switch <id> Switch to session by ID or tab index
/session:close [--force] Close the current session tab
/session:delete <id> [--yes/-y] Delete a saved session
/session:rename <name> Rename the current session
/session:export [--format md] [path] Export session (already implemented)
/session:import <path> Import session (already implemented)

Subtasks

  • Implement /session:create [--persona <name>] subcommand in _session_command()
  • Implement /session:list subcommand — display all sessions in TUI output
  • Enhance /session:show to display full session details (messages, linked plans, token usage)
  • Implement /session:switch <id> subcommand — switch active session tab by ID or index
  • Implement /session:close [--force] subcommand — close current session tab
  • Implement /session:delete <id> [--yes/-y] subcommand — delete a saved session with confirmation
  • Implement /session:rename <name> subcommand — rename the current session
  • Tests (Behave): Add BDD scenarios for each new subcommand (happy path + error cases)
  • Tests (Robot): Add integration test exercising all session slash commands end-to-end
  • 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 six missing session subcommands (create, list, switch, close, delete, rename) are implemented and functional in the TUI.
  • The show subcommand displays full session details as specified (messages, linked plans, token usage).
  • 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 lines providing relevant 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%.

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

## Metadata - **Branch**: `fix/tui-session-slash-command-subcommands` - **Commit Message**: `fix(tui): implement missing session slash command subcommands in TuiCommandRouter` - **Milestone**: *(backlog — no milestone assigned)* - **Parent Epic**: #868 > **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. ## Background and Context The `TuiCommandRouter._session_command()` method in `src/cleveragents/tui/commands.py` only handles three session subcommands (`show`, `export`, `import`). The specification defines six additional session slash commands that are unimplemented, causing them to silently return an error string instead of performing any action. This is a sub-issue of the broader TUI slash command router gap (issue #3803). Even if the router is fixed to properly dispatch colon-namespaced commands, the session handler itself needs these subcommands implemented. ## Current Behavior `_session_command()` (lines 69–76 of `commands.py`) only handles: ```python 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)}" ``` The following subcommands return `"Unknown session command: <tokens>"`: - `create` → "Unknown session command: create" - `list` → "Unknown session command: list" - `switch <id>` → "Unknown session command: switch <id>" - `close` → "Unknown session command: close" - `delete <id>` → "Unknown session command: delete <id>" - `rename <name>` → "Unknown session command: rename <name>" Additionally, the `show` implementation only returns `f"Current session: {session_id}"` — it does not display the full session details (messages, linked plans, token usage) as specified. **Steps to reproduce:** 1. Launch the TUI: `agents tui` 2. Type `/session:create` → returns "Unknown session command: create" 3. Type `/session:list` → returns "Unknown session command: list" 4. Type `/session:switch <id>` → returns "Unknown session command: switch <id>" 5. Type `/session:close` → returns "Unknown session command: close" 6. Type `/session:delete <id>` → returns "Unknown session command: delete <id>" 7. Type `/session:rename myname` → returns "Unknown session command: rename myname" **Code location:** `src/cleveragents/tui/commands.py` — `_session_command()` method (lines 69–76) ## Expected Behavior Per specification §TUI Slash Command Overlay (lines 29274–29280), the following session slash commands should be fully functional: | Command | Description | |---|---| | `/session:create [--persona <name>]` | Create a new session tab | | `/session:list` | Display all sessions | | `/session:show` | Show full session details (messages, linked plans, token usage) | | `/session:switch <id>` | Switch to session by ID or tab index | | `/session:close [--force]` | Close the current session tab | | `/session:delete <id> [--yes/-y]` | Delete a saved session | | `/session:rename <name>` | Rename the current session | | `/session:export [--format md] [path]` | Export session (already implemented) | | `/session:import <path>` | Import session (already implemented) | ## Subtasks - [ ] Implement `/session:create [--persona <name>]` subcommand in `_session_command()` - [ ] Implement `/session:list` subcommand — display all sessions in TUI output - [ ] Enhance `/session:show` to display full session details (messages, linked plans, token usage) - [ ] Implement `/session:switch <id>` subcommand — switch active session tab by ID or index - [ ] Implement `/session:close [--force]` subcommand — close current session tab - [ ] Implement `/session:delete <id> [--yes/-y]` subcommand — delete a saved session with confirmation - [ ] Implement `/session:rename <name>` subcommand — rename the current session - [ ] Tests (Behave): Add BDD scenarios for each new subcommand (happy path + error cases) - [ ] Tests (Robot): Add integration test exercising all session slash commands end-to-end - [ ] 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 six missing session subcommands (`create`, `list`, `switch`, `close`, `delete`, `rename`) are implemented and functional in the TUI. - The `show` subcommand displays full session details as specified (messages, linked plans, token usage). - 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 lines providing relevant 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%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

Label compliance fix applied:

  • Removed conflicting label: State/Unverified
  • Reason: Issue had both State/In Progress and State/Unverified. Keeping State/In Progress as the more advanced state.

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

Label compliance fix applied: - Removed conflicting label: `State/Unverified` - Reason: Issue had both `State/In Progress` and `State/Unverified`. Keeping `State/In Progress` as the more advanced state. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-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.

Blocks
Reference
cleveragents/cleveragents-core#3808
No description provided.