UAT: TUI shell mode does not activate on $ prefix — spec requires both ! and $ to activate shell mode #4145

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

Metadata

  • Branch: fix/tui-shell-mode-dollar-prefix
  • Commit Message: fix(tui): activate shell mode on $ prefix in addition to !
  • Milestone: (none — backlog)
  • 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.

Bug Report

What Was Tested

Code-level analysis of src/cleveragents/tui/input/modes.py — specifically the InputModeRouter.detect_mode() static method.

Expected Behavior (from spec)

The specification (Shell Mode section, line ~29362–29364) states:

Shell mode provides direct OS command execution from the TUI prompt. Typing ! as the first character changes the prompt symbol to $ and enables shell syntax highlighting...

The TUI key bindings table (line ~30281) also states:

| ! or $ (at position 0) | Activate shell mode |

The spec also shows the prompt bar hint:

▌!▐ shell

And the help panel overlay in src/cleveragents/tui/widgets/help_panel_overlay.py documents:

("! / $", "Activate shell mode"),

Actual Behavior

The InputModeRouter.detect_mode() method in src/cleveragents/tui/input/modes.py only checks for ! as a shell mode trigger:

@staticmethod
def detect_mode(text: str) -> InputMode:
    stripped = text.lstrip()
    if stripped.startswith("/"):
        return InputMode.COMMAND
    if stripped.startswith("!"):
        return InputMode.SHELL
    return InputMode.NORMAL

Typing $git status will be treated as InputMode.NORMAL instead of InputMode.SHELL. Only !git status activates shell mode.

Note: The HelpPanelOverlay correctly documents ! / $ as shell mode activators, but the actual InputModeRouter implementation does not honor the $ prefix.

Steps to Reproduce

  1. Launch the TUI: agents tui
  2. Type $git status and press Enter
  3. Observe: treated as normal message, not shell command
  4. Type !git status and press Enter
  5. Observe: correctly runs as shell command

Code Location

src/cleveragents/tui/input/modes.py, lines 50–56:

@staticmethod
def detect_mode(text: str) -> InputMode:
    stripped = text.lstrip()
    if stripped.startswith("/"):
        return InputMode.COMMAND
    if stripped.startswith("!"):
        return InputMode.SHELL
    return InputMode.NORMAL

Fix: add or stripped.startswith("$") to the shell mode check.

Subtasks

  • Update InputModeRouter.detect_mode() to also return InputMode.SHELL when input starts with $
  • Update InputModeRouter.process() to strip the $ prefix before passing to run_shell_command() (currently only strips !)
  • Add BDD scenario in features/tui_input_modes.feature for $ prefix shell activation
  • Verify with nox -e unit_tests

Definition of Done

  • $git status activates shell mode and runs the command
  • !git status continues to work as before
  • Unit tests cover both ! and $ shell mode activation
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/tui-shell-mode-dollar-prefix` - **Commit Message**: `fix(tui): activate shell mode on $ prefix in addition to !` - **Milestone**: *(none — backlog)* - **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. ## Bug Report ### What Was Tested Code-level analysis of `src/cleveragents/tui/input/modes.py` — specifically the `InputModeRouter.detect_mode()` static method. ### Expected Behavior (from spec) The specification (Shell Mode section, line ~29362–29364) states: > Shell mode provides direct OS command execution from the TUI prompt. Typing `!` as the first character changes the prompt symbol to `$` and enables shell syntax highlighting... The TUI key bindings table (line ~30281) also states: > | `!` or `$` (at position 0) | Activate shell mode | The spec also shows the prompt bar hint: > `▌!▐` shell And the help panel overlay in `src/cleveragents/tui/widgets/help_panel_overlay.py` documents: ```python ("! / $", "Activate shell mode"), ``` ### Actual Behavior The `InputModeRouter.detect_mode()` method in `src/cleveragents/tui/input/modes.py` only checks for `!` as a shell mode trigger: ```python @staticmethod def detect_mode(text: str) -> InputMode: stripped = text.lstrip() if stripped.startswith("/"): return InputMode.COMMAND if stripped.startswith("!"): return InputMode.SHELL return InputMode.NORMAL ``` Typing `$git status` will be treated as `InputMode.NORMAL` instead of `InputMode.SHELL`. Only `!git status` activates shell mode. Note: The `HelpPanelOverlay` correctly documents `! / $` as shell mode activators, but the actual `InputModeRouter` implementation does not honor the `$` prefix. ### Steps to Reproduce 1. Launch the TUI: `agents tui` 2. Type `$git status` and press Enter 3. Observe: treated as normal message, not shell command 4. Type `!git status` and press Enter 5. Observe: correctly runs as shell command ### Code Location `src/cleveragents/tui/input/modes.py`, lines 50–56: ```python @staticmethod def detect_mode(text: str) -> InputMode: stripped = text.lstrip() if stripped.startswith("/"): return InputMode.COMMAND if stripped.startswith("!"): return InputMode.SHELL return InputMode.NORMAL ``` Fix: add `or stripped.startswith("$")` to the shell mode check. ## Subtasks - [ ] Update `InputModeRouter.detect_mode()` to also return `InputMode.SHELL` when input starts with `$` - [ ] Update `InputModeRouter.process()` to strip the `$` prefix before passing to `run_shell_command()` (currently only strips `!`) - [ ] Add BDD scenario in `features/tui_input_modes.feature` for `$` prefix shell activation - [ ] Verify with `nox -e unit_tests` ## Definition of Done - [ ] `$git status` activates shell mode and runs the command - [ ] `!git status` continues to work as before - [ ] Unit tests cover both `!` and `$` shell mode activation - [ ] All nox stages pass - [ ] Coverage >= 97% --- **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 shell mode behavior - 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 shell mode behavior - 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:54 +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#4145
No description provided.