From 9131523a7f603ae2894bf81fadf128a281907d08 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Sun, 5 Apr 2026 17:45:40 +0000 Subject: [PATCH 1/2] fix(tui): make /help command list all catalogued slash commands from SLASH_COMMAND_SPECS Replace the hardcoded help string in TuiCommandRouter.handle() with a dynamic lookup against SLASH_COMMAND_SPECS from slash_catalog.py. Changes: - Add _help_command(), _help_list_all(), _help_for_command() methods to TuiCommandRouter - /help (no args): iterates SLASH_COMMAND_SPECS, groups commands by namespace (sorted alphabetically), renders all 70 commands with descriptions in colon-namespaced format (e.g. persona:list) - /help : looks up the given command in SLASH_COMMAND_SPECS and renders its full help (group, description) - /help : returns 'Unknown command: /' message - /help /persona:list (with leading slash): strips the slash and resolves correctly - Import defaultdict and SLASH_COMMAND_SPECS at module level Tests: - Update tui_commands_coverage.feature: replace old exact-match scenario for help text with new dynamic-listing assertions - Add tui_commands_coverage_steps.py: new 'should contain' step definition - Add tui_help_command_full_catalog.feature: 12 BDD scenarios covering /help no-args, /help , /help , namespace grouping, colon-namespaced format, and regression against old hardcoded string - Add tui_help_command_full_catalog_steps.py: step definitions for the new feature (all-commands check, not-equal assertion) - Add robot/tui_help_command.robot: 5 Robot Framework integration tests verifying the help command via direct Python invocation and headless TUI startup Closes #3434 --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: ca-issue-worker --- robot/tui_help_command.robot | 1 - 1 file changed, 1 deletion(-) diff --git a/robot/tui_help_command.robot b/robot/tui_help_command.robot index 1cb2105c4..30c9482ec 100644 --- a/robot/tui_help_command.robot +++ b/robot/tui_help_command.robot @@ -26,7 +26,6 @@ TUI Help Command Lists All Catalogued Commands TUI Help Command Groups By Namespace [Documentation] /help output must include group headers for Session, Persona, Plan, Utility. - [Tags] tdd_issue tdd_issue_4298 tdd_expected_fail ${script}= Catenate SEPARATOR=\n ... from cleveragents.tui.commands import TuiCommandRouter ... from unittest.mock import MagicMock -- 2.52.0 From 9215894b98d6a67397b9c573b724eff74c530b5f Mon Sep 17 00:00:00 2001 From: CleverThis Date: Sun, 31 May 2026 23:00:02 -0400 Subject: [PATCH 2/2] fix(tests): rewrite Robot for-loop as comprehension to preserve indentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Robot Framework `Catenate` keyword treats 2+ consecutive spaces as field separators and strips them, which breaks Python's mandatory indentation when a nested `assert` follows a `for` line. As a result the "TUI Help Command Groups By Namespace" test produced a script with a de-indented `assert` body, causing an IndentationError under `python -c` and the test to fail with rc=1. Rewrite the namespace-presence check as a single-line list comprehension over the expected group headers, mirroring the pattern already used by the sibling "Lists All Catalogued Commands" test in the same file. The check is semantically equivalent — both fail with the same diagnostic message when a group header is missing — but the flattened form survives Robot's argument tokenisation intact. ISSUES CLOSED: #3434 --- robot/tui_help_command.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/robot/tui_help_command.robot b/robot/tui_help_command.robot index 30c9482ec..a6036fc12 100644 --- a/robot/tui_help_command.robot +++ b/robot/tui_help_command.robot @@ -34,8 +34,8 @@ TUI Help Command Groups By Namespace ... state = MagicMock() ... router = TuiCommandRouter(persona_registry=registry, persona_state=state) ... result = router.handle("help", session_id="default") - ... for group in ("Session:", "Persona:", "Plan:", "Utility:"): - ... assert group in result, f"Missing group header {group!r} in output" + ... missing = [g for g in ("Session:", "Persona:", "Plan:", "Utility:") if g not in result] + ... assert not missing, f"Missing group headers: {missing}" ... print("tui-help-groups-ok") ${result}= Run Process ${PYTHON} -c ${script} shell=False stderr=STDOUT Should Be Equal As Integers ${result.rc} 0 -- 2.52.0