UAT: TUI slash command router (TuiCommandRouter) only handles persona/session/help - all other slash commands return 'Unknown command' #3803

Open
opened 2026-04-06 06:27:32 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/tui/slash-command-router-missing-namespaces
  • Commit Message: fix(tui): implement full slash command namespace routing in TuiCommandRouter
  • Milestone: (none — backlog)
  • Parent Epic: #868

Background and context

The TuiCommandRouter.handle() method in src/cleveragents/tui/commands.py was implemented with only three slash command namespaces (persona, session, help). The slash catalog (src/cleveragents/tui/slash_catalog.py) defines 60+ slash commands across 14 namespaces, but the router falls through to "Unknown command: /<command>" for all commands outside those three namespaces.

Additionally, the slash catalog uses colon-separated namespaces (e.g., plan:use, session:create) but the router splits on spaces and checks tokens[0], which would be plan:use (the full colon-namespaced command), not plan. The router must handle the colon-separated format correctly.

Current behavior

TuiCommandRouter.handle() (lines 46–56 of commands.py) only routes:

if tokens[0] == "persona":
    return self._persona_command(...)
if tokens[0] == "session":
    return self._session_command(...)
if tokens[0] == "help":
    return self._help_command(...)
return f"Unknown command: /{raw}"

All plan, project, actor, resource, config, tool, skill, invariant, profile, context, scope, and utility slash commands fall through to "Unknown command: /<command>".

Steps to reproduce:

  1. Launch the TUI: agents tui
  2. Type /plan:list and press Enter → returns "Unknown command: /plan:list"
  3. Type /actor:list and press Enter → returns "Unknown command: /actor:list"
  4. Type /resource:list and press Enter → returns "Unknown command: /resource:list"
  5. Type /config:list and press Enter → returns "Unknown command: /config:list"

Code locations:

  • src/cleveragents/tui/commands.pyTuiCommandRouter.handle() method (lines 46–56)
  • src/cleveragents/tui/slash_catalog.py — defines 60+ slash commands that are unhandled

Expected behavior

Per spec §TUI Slash Command Overlay, all of the following slash command groups must be functional:

Namespace Commands
session create, list, show, switch, close, delete, rename, export, import
persona list, set, create, edit, delete, export, import
scope add, remove, clear, show
plan use, list, status, tree, execute, apply, cancel, diff, correct, resume, revert, rollback, explain, errors, artifacts, inspect
project list, create, show, delete, inspect, context:show
actor list, show, set-default
resource list, show, tree, inspect
config list, get, set
tool list, show
skill list, show
invariant list, add, remove
profile list, show
context inspect, set, simulate
Utility /clear, /theme, /settings, /help, /about, /debug

The router must also correctly parse colon-separated namespace:subcommand format (e.g., /plan:list → namespace plan, subcommand list).

Subtasks

  • Audit slash_catalog.py to enumerate all defined slash command namespaces and their subcommands
  • Refactor TuiCommandRouter.handle() to parse colon-separated namespace:subcommand format correctly
  • Implement _scope_command() handler and wire it into the router
  • Implement _plan_command() handler and wire it into the router
  • Implement _project_command() handler and wire it into the router
  • Implement _actor_command() handler and wire it into the router
  • Implement _resource_command() handler and wire it into the router
  • Implement _config_command() handler and wire it into the router
  • Implement _tool_command() handler and wire it into the router
  • Implement _skill_command() handler and wire it into the router
  • Implement _invariant_command() handler and wire it into the router
  • Implement _profile_command() handler and wire it into the router
  • Implement _context_command() handler and wire it into the router
  • Implement utility command handlers (/clear, /theme, /settings, /about, /debug) and wire them into the router
  • Ensure unknown commands still return a helpful error message listing available namespaces
  • Tests (Behave): Add scenarios covering each slash command namespace routing
  • Tests (Robot): Add integration tests for TUI slash command dispatch
  • 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.
  • TuiCommandRouter.handle() correctly dispatches all 14 slash command namespaces defined in slash_catalog.py.
  • Colon-separated namespace:subcommand format (e.g., /plan:list) is parsed correctly.
  • No slash command defined in slash_catalog.py returns "Unknown command" when invoked.
  • 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%.

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.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/slash-command-router-missing-namespaces` - **Commit Message**: `fix(tui): implement full slash command namespace routing in TuiCommandRouter` - **Milestone**: *(none — backlog)* - **Parent Epic**: #868 ## Background and context The `TuiCommandRouter.handle()` method in `src/cleveragents/tui/commands.py` was implemented with only three slash command namespaces (`persona`, `session`, `help`). The slash catalog (`src/cleveragents/tui/slash_catalog.py`) defines 60+ slash commands across 14 namespaces, but the router falls through to `"Unknown command: /<command>"` for all commands outside those three namespaces. Additionally, the slash catalog uses colon-separated namespaces (e.g., `plan:use`, `session:create`) but the router splits on spaces and checks `tokens[0]`, which would be `plan:use` (the full colon-namespaced command), not `plan`. The router must handle the colon-separated format correctly. ## Current behavior `TuiCommandRouter.handle()` (lines 46–56 of `commands.py`) only routes: ```python if tokens[0] == "persona": return self._persona_command(...) if tokens[0] == "session": return self._session_command(...) if tokens[0] == "help": return self._help_command(...) return f"Unknown command: /{raw}" ``` All `plan`, `project`, `actor`, `resource`, `config`, `tool`, `skill`, `invariant`, `profile`, `context`, `scope`, and utility slash commands fall through to `"Unknown command: /<command>"`. **Steps to reproduce:** 1. Launch the TUI: `agents tui` 2. Type `/plan:list` and press Enter → returns `"Unknown command: /plan:list"` 3. Type `/actor:list` and press Enter → returns `"Unknown command: /actor:list"` 4. Type `/resource:list` and press Enter → returns `"Unknown command: /resource:list"` 5. Type `/config:list` and press Enter → returns `"Unknown command: /config:list"` **Code locations:** - `src/cleveragents/tui/commands.py` — `TuiCommandRouter.handle()` method (lines 46–56) - `src/cleveragents/tui/slash_catalog.py` — defines 60+ slash commands that are unhandled ## Expected behavior Per spec §TUI Slash Command Overlay, all of the following slash command groups must be functional: | Namespace | Commands | |-----------|----------| | `session` | `create`, `list`, `show`, `switch`, `close`, `delete`, `rename`, `export`, `import` | | `persona` | `list`, `set`, `create`, `edit`, `delete`, `export`, `import` | | `scope` | `add`, `remove`, `clear`, `show` | | `plan` | `use`, `list`, `status`, `tree`, `execute`, `apply`, `cancel`, `diff`, `correct`, `resume`, `revert`, `rollback`, `explain`, `errors`, `artifacts`, `inspect` | | `project` | `list`, `create`, `show`, `delete`, `inspect`, `context:show` | | `actor` | `list`, `show`, `set-default` | | `resource` | `list`, `show`, `tree`, `inspect` | | `config` | `list`, `get`, `set` | | `tool` | `list`, `show` | | `skill` | `list`, `show` | | `invariant` | `list`, `add`, `remove` | | `profile` | `list`, `show` | | `context` | `inspect`, `set`, `simulate` | | Utility | `/clear`, `/theme`, `/settings`, `/help`, `/about`, `/debug` | The router must also correctly parse colon-separated namespace:subcommand format (e.g., `/plan:list` → namespace `plan`, subcommand `list`). ## Subtasks - [ ] Audit `slash_catalog.py` to enumerate all defined slash command namespaces and their subcommands - [ ] Refactor `TuiCommandRouter.handle()` to parse colon-separated namespace:subcommand format correctly - [ ] Implement `_scope_command()` handler and wire it into the router - [ ] Implement `_plan_command()` handler and wire it into the router - [ ] Implement `_project_command()` handler and wire it into the router - [ ] Implement `_actor_command()` handler and wire it into the router - [ ] Implement `_resource_command()` handler and wire it into the router - [ ] Implement `_config_command()` handler and wire it into the router - [ ] Implement `_tool_command()` handler and wire it into the router - [ ] Implement `_skill_command()` handler and wire it into the router - [ ] Implement `_invariant_command()` handler and wire it into the router - [ ] Implement `_profile_command()` handler and wire it into the router - [ ] Implement `_context_command()` handler and wire it into the router - [ ] Implement utility command handlers (`/clear`, `/theme`, `/settings`, `/about`, `/debug`) and wire them into the router - [ ] Ensure unknown commands still return a helpful error message listing available namespaces - [ ] Tests (Behave): Add scenarios covering each slash command namespace routing - [ ] Tests (Robot): Add integration tests for TUI slash command dispatch - [ ] 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. - `TuiCommandRouter.handle()` correctly dispatches all 14 slash command namespaces defined in `slash_catalog.py`. - Colon-separated namespace:subcommand format (e.g., `/plan:list`) is parsed correctly. - No slash command defined in `slash_catalog.py` returns `"Unknown command"` when invoked. - 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%. > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.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
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#3803
No description provided.