UAT: TUI shell mode does not recognize $ prefix — help panel documents $ / ! for shell mode but InputModeRouter only handles ! #2993

Open
opened 2026-04-05 03:19:59 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/tui-shell-mode-dollar-prefix
  • Commit Message: fix(tui): add dollar-sign prefix support to InputModeRouter shell mode detection
  • Milestone: v3.7.0
  • Parent Epic: #868

Description

The TUI help panel overlay (src/cleveragents/tui/widgets/help_panel_overlay.py) documents that shell mode is activated by ! / $ (line 39: ("! / $", "Activate shell mode")). However, the InputModeRouter.detect_mode() method in src/cleveragents/tui/input/modes.py only checks for ! prefix (line 54: if stripped.startswith("!")). The $ prefix is never checked and falls through to InputMode.NORMAL, meaning the text is treated as a regular message to the orchestrator instead of a shell command.

This is a spec/implementation inconsistency: the help panel (which is the user-facing documentation) says $ activates shell mode, but the implementation does not support it.

Current behaviour:

  • !ls → correctly activates shell mode and runs ls
  • $ls → incorrectly treated as normal text, sent to orchestrator as a message

Expected behaviour per spec (as documented in the help panel):

  • Both !ls and $ls should activate shell mode and execute ls

Code locations:

  • src/cleveragents/tui/widgets/help_panel_overlay.py line 39: ("! / $", "Activate shell mode") — documents $ as shell mode prefix
  • src/cleveragents/tui/input/modes.py lines 49–56: detect_mode() only checks for !, not $

Steps to reproduce:

  1. Launch the TUI: agents tui
  2. Type $ls in the prompt and submit
  3. The text $ls is treated as a normal message to the orchestrator instead of running ls as a shell command

Proposed fix — in src/cleveragents/tui/input/modes.py, update detect_mode():

if stripped.startswith("!") or stripped.startswith("$"):
    return InputMode.SHELL

Subtasks

  • Update InputModeRouter.detect_mode() in src/cleveragents/tui/input/modes.py to check for $ prefix
  • Update process() to strip the $ prefix when extracting the shell command
  • Add BDD scenario for $ prefix shell mode in features/tui_input_modes.feature
  • Verify nox -e unit_tests passes

Definition of Done

  • $command activates shell mode identically to !command
  • BDD scenario covers $ prefix shell mode
  • nox -e typecheck passes
  • nox -e unit_tests passes
  • All nox stages pass
  • Coverage >= 97%

This issue was filed by the UAT Testing agent (ca-uat-tester) as part of automated acceptance testing.


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

## Metadata - **Branch**: `fix/tui-shell-mode-dollar-prefix` - **Commit Message**: `fix(tui): add dollar-sign prefix support to InputModeRouter shell mode detection` - **Milestone**: v3.7.0 - **Parent Epic**: #868 ## Description The TUI help panel overlay (`src/cleveragents/tui/widgets/help_panel_overlay.py`) documents that shell mode is activated by `! / $` (line 39: `("! / $", "Activate shell mode")`). However, the `InputModeRouter.detect_mode()` method in `src/cleveragents/tui/input/modes.py` only checks for `!` prefix (line 54: `if stripped.startswith("!")`). The `$` prefix is never checked and falls through to `InputMode.NORMAL`, meaning the text is treated as a regular message to the orchestrator instead of a shell command. This is a spec/implementation inconsistency: the help panel (which is the user-facing documentation) says `$` activates shell mode, but the implementation does not support it. **Current behaviour:** - `!ls` → correctly activates shell mode and runs `ls` - `$ls` → incorrectly treated as normal text, sent to orchestrator as a message **Expected behaviour per spec (as documented in the help panel):** - Both `!ls` and `$ls` should activate shell mode and execute `ls` **Code locations:** - `src/cleveragents/tui/widgets/help_panel_overlay.py` line 39: `("! / $", "Activate shell mode")` — documents `$` as shell mode prefix - `src/cleveragents/tui/input/modes.py` lines 49–56: `detect_mode()` only checks for `!`, not `$` **Steps to reproduce:** 1. Launch the TUI: `agents tui` 2. Type `$ls` in the prompt and submit 3. The text `$ls` is treated as a normal message to the orchestrator instead of running `ls` as a shell command **Proposed fix** — in `src/cleveragents/tui/input/modes.py`, update `detect_mode()`: ```python if stripped.startswith("!") or stripped.startswith("$"): return InputMode.SHELL ``` ## Subtasks - [ ] Update `InputModeRouter.detect_mode()` in `src/cleveragents/tui/input/modes.py` to check for `$` prefix - [ ] Update `process()` to strip the `$` prefix when extracting the shell command - [ ] Add BDD scenario for `$` prefix shell mode in `features/tui_input_modes.feature` - [ ] Verify `nox -e unit_tests` passes ## Definition of Done - [ ] `$command` activates shell mode identically to `!command` - [ ] BDD scenario covers `$` prefix shell mode - [ ] `nox -e typecheck` passes - [ ] `nox -e unit_tests` passes - [ ] All nox stages pass - [ ] Coverage >= 97% --- This issue was filed by the UAT Testing agent (ca-uat-tester) as part of automated acceptance testing. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-05 03:20:49 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels: Priority/Medium, State/Unverified, Type/Bug
  • Reason: Issue was missing all required labels per CONTRIBUTING.md. Inferred Type/Bug from the "UAT:" prefix. Applied Priority/Medium and State/Unverified as defaults.

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

Label compliance fix applied: - Added missing labels: `Priority/Medium`, `State/Unverified`, `Type/Bug` - Reason: Issue was missing all required labels per CONTRIBUTING.md. Inferred `Type/Bug` from the "UAT:" prefix. Applied `Priority/Medium` and `State/Unverified` as defaults. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Confirmed
  • MoSCoW: Should Have

Valid finding verified during batch triage.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Confirmed - **MoSCoW**: Should Have Valid finding verified during batch triage. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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#2993
No description provided.