UAT: TUI prompt uses Input widget instead of TextArea — multiline detection, history navigation, and mode-dependent symbol not implemented #5071

Open
opened 2026-04-09 00:54:14 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: TUI — Prompt Architecture

Severity: High (prompt functionality severely limited)

What Was Tested

The prompt widget architecture as defined in the specification (§ Prompt Architecture Detail, §MainScreen Layout).

Expected Behavior (from spec)

The spec defines a PromptTextArea with:

  1. Mode-dependent symbol: (normal), $ (shell), (multi-line)
  2. Multiline detection: Auto-switches to when input contains \n, triple backticks, or shift+enter/ctrl+j is pressed. In multiline mode, enter inserts newline; ctrl+enter submits.
  3. History navigation: Two independent JSONL history files per project:
    • ~/.local/state/cleveragents/history/<project-hash>/prompt.jsonl
    • ~/.local/state/cleveragents/history/<project-hash>/shell.jsonl
    • up at row 0 → previous history entry
    • down at last row → next history entry
    • Capped at 10,000 entries
  4. Key passthrough: When conversation Window has focus, printable characters forwarded to prompt TextArea

Actual Behavior (from code analysis)

The PromptInput in src/cleveragents/tui/widgets/prompt.py extends Textual's Input widget (not TextArea):

class PromptInput(_InputBase):  # _InputBase = textual.widgets.Input
    def consume_text(self) -> PromptSubmitted:
        text = self.value
        self.value = ""
        return PromptSubmitted(text=text)

Issues:

  1. Input is single-line only — no multiline support, no mode
  2. No mode-dependent prompt symbol — always shows default Input placeholder
  3. No history navigation — no JSONL history files, no up/down history
  4. No key passthrough — conversation widget doesn't forward keypresses to prompt
  5. No shift+enter/ctrl+j for newline insertion

Steps to Reproduce

  1. Run agents tui
  2. Press shift+enter — no newline inserted (single-line Input)
  3. Press up arrow — no history navigation
  4. Type a multi-line message — impossible with single-line Input

Code Location

  • src/cleveragents/tui/widgets/prompt.py — extends Input not TextArea

Impact

The TUI prompt is severely limited compared to the spec:

  • Cannot compose multi-line prompts
  • No prompt history
  • No mode-dependent visual feedback
  • Cannot paste multi-line content

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area:** TUI — Prompt Architecture **Severity:** High (prompt functionality severely limited) ### What Was Tested The prompt widget architecture as defined in the specification (§ Prompt Architecture Detail, §MainScreen Layout). ### Expected Behavior (from spec) The spec defines a `PromptTextArea` with: 1. **Mode-dependent symbol**: `❯` (normal), `$` (shell), `☰` (multi-line) 2. **Multiline detection**: Auto-switches to `☰` when input contains `\n`, triple backticks, or `shift+enter`/`ctrl+j` is pressed. In multiline mode, `enter` inserts newline; `ctrl+enter` submits. 3. **History navigation**: Two independent JSONL history files per project: - `~/.local/state/cleveragents/history/<project-hash>/prompt.jsonl` - `~/.local/state/cleveragents/history/<project-hash>/shell.jsonl` - `up` at row 0 → previous history entry - `down` at last row → next history entry - Capped at 10,000 entries 4. **Key passthrough**: When conversation Window has focus, printable characters forwarded to prompt TextArea ### Actual Behavior (from code analysis) The `PromptInput` in `src/cleveragents/tui/widgets/prompt.py` extends Textual's `Input` widget (not `TextArea`): ```python class PromptInput(_InputBase): # _InputBase = textual.widgets.Input def consume_text(self) -> PromptSubmitted: text = self.value self.value = "" return PromptSubmitted(text=text) ``` Issues: 1. **`Input` is single-line only** — no multiline support, no `☰` mode 2. **No mode-dependent prompt symbol** — always shows default Input placeholder 3. **No history navigation** — no JSONL history files, no `up`/`down` history 4. **No key passthrough** — conversation widget doesn't forward keypresses to prompt 5. **No `shift+enter`/`ctrl+j` for newline insertion** ### Steps to Reproduce 1. Run `agents tui` 2. Press `shift+enter` — no newline inserted (single-line Input) 3. Press `up` arrow — no history navigation 4. Type a multi-line message — impossible with single-line Input ### Code Location - `src/cleveragents/tui/widgets/prompt.py` — extends `Input` not `TextArea` ### Impact The TUI prompt is severely limited compared to the spec: - Cannot compose multi-line prompts - No prompt history - No mode-dependent visual feedback - Cannot paste multi-line content --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.7.0 milestone 2026-04-09 01:02:21 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — TUI spec compliance bug; deviates from documented TUI behavior
  • Milestone: v3.7.0 (TUI milestone)
  • Story Points: 3 — M
  • MoSCoW: Must Have — TUI spec compliance is required for the TUI Legendary
  • Parent Epic: #4963 or #4966 (TUI Epics)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — TUI spec compliance bug; deviates from documented TUI behavior - **Milestone**: v3.7.0 (TUI milestone) - **Story Points**: 3 — M - **MoSCoW**: Must Have — TUI spec compliance is required for the TUI Legendary - **Parent Epic**: #4963 or #4966 (TUI Epics) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: 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.

Reference
cleveragents/cleveragents-core#5071
No description provided.