UAT: TuiCommandRouter only dispatches persona, session, and help — 10+ slash command groups return 'Unknown command' #4146

Open
opened 2026-04-06 10:58:05 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/tui-command-router-missing-dispatchers
  • Commit Message: fix(tui): add dispatch handlers for all slash command groups in TuiCommandRouter
  • Milestone: (none — backlog)
  • Parent Epic: #868

Backlog note: This issue was discovered during UAT of the Textual TUI Components feature area. It does not block milestone completion and has been placed in the backlog for human review and future milestone assignment.

Bug Report

What Was Tested

Code-level analysis of src/cleveragents/tui/commands.py — specifically the TuiCommandRouter.handle() method and its dispatch logic.

Expected Behavior (from spec)

The specification defines a comprehensive slash command catalog (lines ~29270–29360) with 14 command groups:

  • Session, Persona, Scope, Plan, Project, Actor, Resource, Config, Tool, Skill, Invariant, Profile, Context, Utility

The TuiCommandRouter should dispatch all of these to the appropriate backend services via the DI container.

Actual Behavior

The TuiCommandRouter.handle() method in src/cleveragents/tui/commands.py only dispatches 3 command groups:

def handle(self, raw: str, *, session_id: str) -> str:
    tokens = raw.strip().split()
    if not tokens:
        return "Empty command"
    if tokens[0] == "persona":
        return self._persona_command(tokens[1:], session_id=session_id)
    if tokens[0] == "session":
        return self._session_command(tokens[1:], session_id=session_id)
    if tokens[0] == "help":
        return "Commands: /persona, /session, /help"
    return f"Unknown command: /{raw}"  # ← All other commands fall here

The following slash command groups are entirely unimplemented and return "Unknown command: /...":

  • /plan:* (14 plan commands)
  • /project:* (6 project commands)
  • /scope:* (4 scope commands)
  • /actor:* (3 actor commands)
  • /resource:* (4 resource commands)
  • /config:* (3 config commands)
  • /tool:* (2 tool commands)
  • /skill:* (2 skill commands)
  • /invariant:* (3 invariant commands)
  • /profile:* (2 profile commands)
  • /context:* (3 context commands)
  • /clear, /theme, /settings, /about, /debug (utility commands)

Additionally, the handle() method uses space-split tokens (tokens[0] == "persona") but the slash catalog uses colon-separated commands (persona:list, plan:use). The routing logic does not handle the colon-separated format that the SlashCommandOverlay presents to users.

Code Location

src/cleveragents/tui/commands.py, lines 46–56 — the handle() method.

Additional Issue: Colon-Separated Command Format Not Handled

The SlashCommandOverlay displays commands like /persona:list, /plan:use, /session:export. When the user selects one of these, the TUI submits the full command string (e.g., persona:list). However, handle() splits on spaces and checks tokens[0], so persona:list would match tokens[0] == "persona:list" — but the code only checks for "persona" (without the colon and subcommand). This means even the persona and session commands may not route correctly when invoked via the overlay's colon-separated format.

Subtasks

  • Refactor handle() to parse colon-separated command format (e.g., "persona:list" → group "persona", subcommand "list")
  • Add _plan_command() dispatcher routing to container.plan_service()
  • Add _project_command() dispatcher routing to container.project_service()
  • Add _scope_command() dispatcher updating persona_state scope
  • Add _actor_command() dispatcher routing to container.actor_registry()
  • Add _resource_command() dispatcher routing to container.resource_service()
  • Add _config_command() dispatcher routing to container.config_service()
  • Add _tool_command() dispatcher routing to container.tool_registry()
  • Add _skill_command() dispatcher routing to container.skill_registry()
  • Add _invariant_command() dispatcher routing to container.invariant_service()
  • Add _profile_command() dispatcher routing to container.profile_service()
  • Add _context_command() dispatcher routing to container.context_service()
  • Add utility command handlers (clear, theme, settings, about, debug)
  • Update help response to list all command groups
  • Add BDD scenarios for each new command group
  • Verify with nox -e unit_tests

Definition of Done

  • All 14 slash command groups are dispatched by TuiCommandRouter
  • Colon-separated command format is correctly parsed
  • Unknown commands return a helpful error message
  • nox -e unit_tests passes

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/tui-command-router-missing-dispatchers` - **Commit Message**: `fix(tui): add dispatch handlers for all slash command groups in TuiCommandRouter` - **Milestone**: *(none — backlog)* - **Parent Epic**: #868 > **Backlog note:** This issue was discovered during UAT of the Textual TUI Components feature area. It does not block milestone completion and has been placed in the backlog for human review and future milestone assignment. ## Bug Report ### What Was Tested Code-level analysis of `src/cleveragents/tui/commands.py` — specifically the `TuiCommandRouter.handle()` method and its dispatch logic. ### Expected Behavior (from spec) The specification defines a comprehensive slash command catalog (lines ~29270–29360) with **14 command groups**: - Session, Persona, Scope, Plan, Project, Actor, Resource, Config, Tool, Skill, Invariant, Profile, Context, Utility The `TuiCommandRouter` should dispatch all of these to the appropriate backend services via the DI container. ### Actual Behavior The `TuiCommandRouter.handle()` method in `src/cleveragents/tui/commands.py` only dispatches **3 command groups**: ```python def handle(self, raw: str, *, session_id: str) -> str: tokens = raw.strip().split() if not tokens: return "Empty command" if tokens[0] == "persona": return self._persona_command(tokens[1:], session_id=session_id) if tokens[0] == "session": return self._session_command(tokens[1:], session_id=session_id) if tokens[0] == "help": return "Commands: /persona, /session, /help" return f"Unknown command: /{raw}" # ← All other commands fall here ``` The following slash command groups are **entirely unimplemented** and return `"Unknown command: /..."`: - `/plan:*` (14 plan commands) - `/project:*` (6 project commands) - `/scope:*` (4 scope commands) - `/actor:*` (3 actor commands) - `/resource:*` (4 resource commands) - `/config:*` (3 config commands) - `/tool:*` (2 tool commands) - `/skill:*` (2 skill commands) - `/invariant:*` (3 invariant commands) - `/profile:*` (2 profile commands) - `/context:*` (3 context commands) - `/clear`, `/theme`, `/settings`, `/about`, `/debug` (utility commands) Additionally, the `handle()` method uses space-split tokens (`tokens[0] == "persona"`) but the slash catalog uses colon-separated commands (`persona:list`, `plan:use`). The routing logic does not handle the colon-separated format that the `SlashCommandOverlay` presents to users. ### Code Location `src/cleveragents/tui/commands.py`, lines 46–56 — the `handle()` method. ### Additional Issue: Colon-Separated Command Format Not Handled The `SlashCommandOverlay` displays commands like `/persona:list`, `/plan:use`, `/session:export`. When the user selects one of these, the TUI submits the full command string (e.g., `persona:list`). However, `handle()` splits on spaces and checks `tokens[0]`, so `persona:list` would match `tokens[0] == "persona:list"` — but the code only checks for `"persona"` (without the colon and subcommand). This means even the persona and session commands may not route correctly when invoked via the overlay's colon-separated format. ## Subtasks - [ ] Refactor `handle()` to parse colon-separated command format (e.g., `"persona:list"` → group `"persona"`, subcommand `"list"`) - [ ] Add `_plan_command()` dispatcher routing to `container.plan_service()` - [ ] Add `_project_command()` dispatcher routing to `container.project_service()` - [ ] Add `_scope_command()` dispatcher updating `persona_state` scope - [ ] Add `_actor_command()` dispatcher routing to `container.actor_registry()` - [ ] Add `_resource_command()` dispatcher routing to `container.resource_service()` - [ ] Add `_config_command()` dispatcher routing to `container.config_service()` - [ ] Add `_tool_command()` dispatcher routing to `container.tool_registry()` - [ ] Add `_skill_command()` dispatcher routing to `container.skill_registry()` - [ ] Add `_invariant_command()` dispatcher routing to `container.invariant_service()` - [ ] Add `_profile_command()` dispatcher routing to `container.profile_service()` - [ ] Add `_context_command()` dispatcher routing to `container.context_service()` - [ ] Add utility command handlers (`clear`, `theme`, `settings`, `about`, `debug`) - [ ] Update `help` response to list all command groups - [ ] Add BDD scenarios for each new command group - [ ] Verify with `nox -e unit_tests` ## Definition of Done - All 14 slash command groups are dispatched by `TuiCommandRouter` - Colon-separated command format is correctly parsed - Unknown commands return a helpful error message - `nox -e unit_tests` passes --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.6.0 milestone 2026-04-06 18:07:47 +00:00
Author
Owner

Milestone Triage Decision: Moved to Backlog (Defer to M8)

This TUI feature has been moved out of v3.6.0 during aggressive milestone triage. TUI features belong in M8 (v3.7.0), not in Advanced Concepts milestone.

Reasoning:

  • v3.6.0 focus: Advanced concepts that extend beyond core MVP but do NOT require TUI or Server
  • This issue: TUI command router - belongs in M8 TUI milestone
  • Impact: User interface enhancement, not advanced conceptual capability

Will be addressed in M8 (v3.7.0) TUI milestone as part of comprehensive TUI implementation.

**Milestone Triage Decision: Moved to Backlog (Defer to M8)** This TUI feature has been moved out of v3.6.0 during aggressive milestone triage. TUI features belong in M8 (v3.7.0), not in Advanced Concepts milestone. **Reasoning:** - v3.6.0 focus: Advanced concepts that extend beyond core MVP but do NOT require TUI or Server - This issue: TUI command router - belongs in M8 TUI milestone - Impact: User interface enhancement, not advanced conceptual capability Will be addressed in M8 (v3.7.0) TUI milestone as part of comprehensive TUI implementation.
freemo removed this from the v3.6.0 milestone 2026-04-06 20:39:55 +00:00
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:10:38 +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#4146
No description provided.