UAT: TUI app missing tab key binding for persona cycling — only ctrl+tab preset cycling is implemented #3981

Closed
opened 2026-04-06 08:15:54 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/backlog-tui-tab-persona-cycling
  • Commit Message: fix(tui): add tab key binding for persona cycling
  • Milestone: None (Backlog)
  • Parent Epic: #868

Summary

The TUI app (src/cleveragents/tui/app.py) is missing the tab key binding for cycling through personas. The spec and ADR-045 define tab as the primary way to cycle between personas, but the current BINDINGS only includes ctrl+t for preset cycling. There is no action_cycle_persona method and no tab binding.

Backlog note: This issue was discovered during autonomous UAT testing 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.

Current Behavior

The TUI app's BINDINGS in src/cleveragents/tui/app.py (lines 92-96) only defines:

BINDINGS: ClassVar[list[tuple[str, str, str]]] = [
    ("ctrl+q", "quit", "Quit"),
    ("f1", "help", "Help"),
    ("ctrl+t", "cycle_preset", "Cycle Preset"),
]

There is no tab binding for persona cycling. The action_cycle_preset() method (line 151) cycles through presets, but there is no corresponding action_cycle_persona() method.

Additionally, the spec footer bar shows tab Persona as a key binding (spec line ~28948), but this is not implemented.

Expected Behavior (from spec and ADR-045)

Per docs/specification.md §Persona Cycling (line ~29131):

tab cycles through personas in the configured cycle list.

Per docs/adr/ADR-045-tui-persona-system.md §Tab Cycling Behavior:

The tab key in the main chat prompt cycles through personas in the user's configured cycle list:

tab:       persona_1 → persona_2 → persona_3 → persona_1 → ...
shift+tab: (used for sidebar cycling, NOT persona reverse-cycling)

The cycle list is the set of personas with cycle_order > 0, sorted by cycle_order.

Per docs/specification.md §Key Bindings (line ~28948), the footer shows:

F1 Help │ shift+tab Sidebar │ tab Persona │ ctrl+tab Preset │ ctrl+s Sessions │ ctrl+q Quit

Steps to Reproduce

  1. Create two personas with cycle_order: 1 and cycle_order: 2
  2. Launch the TUI: agents tui
  3. Press tab in the prompt
  4. Observe: No persona cycling occurs (tab likely moves focus between widgets instead)

Code Location

  • Missing binding: src/cleveragents/tui/app.py, BINDINGS class variable (lines 92-96)
  • Missing method: src/cleveragents/tui/app.py — no action_cycle_persona() method exists
  • Existing preset cycling reference: src/cleveragents/tui/app.py, action_cycle_preset() (lines 151-153)
  • PersonaState cycle support: src/cleveragents/tui/persona/state.py — note that PersonaState does NOT have a cycle_persona() method; only cycle_preset() exists. A cycle_persona() method would need to be added to PersonaState as well.

Subtasks

  • Add cycle_persona() method to PersonaState in src/cleveragents/tui/persona/state.py that cycles through personas with cycle_order > 0 sorted by cycle_order
  • Add ("tab", "cycle_persona", "Cycle Persona") to BINDINGS in src/cleveragents/tui/app.py
  • Implement action_cycle_persona() in the TUI app that calls persona_state.cycle_persona(session_id) and refreshes the PersonaBar
  • Add Behave BDD tests for persona cycling behavior
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • tab key cycles through personas with cycle_order > 0 in the TUI
  • PersonaBar updates immediately when cycling
  • PersonaState.cycle_persona() method is implemented and tested
  • BDD tests verify the cycling behavior
  • All subtasks above are completed and checked off
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/backlog-tui-tab-persona-cycling` - **Commit Message**: `fix(tui): add tab key binding for persona cycling` - **Milestone**: None (Backlog) - **Parent Epic**: #868 ## Summary The TUI app (`src/cleveragents/tui/app.py`) is missing the `tab` key binding for cycling through personas. The spec and ADR-045 define `tab` as the primary way to cycle between personas, but the current `BINDINGS` only includes `ctrl+t` for preset cycling. There is no `action_cycle_persona` method and no `tab` binding. > **Backlog note:** This issue was discovered during autonomous UAT testing 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. ## Current Behavior The TUI app's `BINDINGS` in `src/cleveragents/tui/app.py` (lines 92-96) only defines: ```python BINDINGS: ClassVar[list[tuple[str, str, str]]] = [ ("ctrl+q", "quit", "Quit"), ("f1", "help", "Help"), ("ctrl+t", "cycle_preset", "Cycle Preset"), ] ``` There is no `tab` binding for persona cycling. The `action_cycle_preset()` method (line 151) cycles through presets, but there is no corresponding `action_cycle_persona()` method. Additionally, the spec footer bar shows `tab Persona` as a key binding (spec line ~28948), but this is not implemented. ## Expected Behavior (from spec and ADR-045) Per `docs/specification.md` §Persona Cycling (line ~29131): > `tab` cycles through personas in the configured cycle list. Per `docs/adr/ADR-045-tui-persona-system.md` §Tab Cycling Behavior: > The `tab` key in the main chat prompt cycles through personas in the user's configured cycle list: > ``` > tab: persona_1 → persona_2 → persona_3 → persona_1 → ... > shift+tab: (used for sidebar cycling, NOT persona reverse-cycling) > ``` > The cycle list is the set of personas with `cycle_order > 0`, sorted by `cycle_order`. Per `docs/specification.md` §Key Bindings (line ~28948), the footer shows: ``` F1 Help │ shift+tab Sidebar │ tab Persona │ ctrl+tab Preset │ ctrl+s Sessions │ ctrl+q Quit ``` ## Steps to Reproduce 1. Create two personas with `cycle_order: 1` and `cycle_order: 2` 2. Launch the TUI: `agents tui` 3. Press `tab` in the prompt 4. Observe: No persona cycling occurs (tab likely moves focus between widgets instead) ## Code Location - **Missing binding**: `src/cleveragents/tui/app.py`, `BINDINGS` class variable (lines 92-96) - **Missing method**: `src/cleveragents/tui/app.py` — no `action_cycle_persona()` method exists - **Existing preset cycling reference**: `src/cleveragents/tui/app.py`, `action_cycle_preset()` (lines 151-153) - **PersonaState cycle support**: `src/cleveragents/tui/persona/state.py` — note that `PersonaState` does NOT have a `cycle_persona()` method; only `cycle_preset()` exists. A `cycle_persona()` method would need to be added to `PersonaState` as well. ## Subtasks - [ ] Add `cycle_persona()` method to `PersonaState` in `src/cleveragents/tui/persona/state.py` that cycles through personas with `cycle_order > 0` sorted by `cycle_order` - [ ] Add `("tab", "cycle_persona", "Cycle Persona")` to `BINDINGS` in `src/cleveragents/tui/app.py` - [ ] Implement `action_cycle_persona()` in the TUI app that calls `persona_state.cycle_persona(session_id)` and refreshes the PersonaBar - [ ] Add Behave BDD tests for persona cycling behavior - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - [ ] `tab` key cycles through personas with `cycle_order > 0` in the TUI - [ ] PersonaBar updates immediately when cycling - [ ] `PersonaState.cycle_persona()` method is implemented and tested - [ ] BDD tests verify the cycling behavior - [ ] All subtasks above are completed and checked off - [ ] A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation - [ ] The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly - [ ] The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Superseded by #4044

This issue specifically covers the missing tab key binding for persona cycling. Issue #4044 is a comprehensive tracking issue covering ALL missing TUI key bindings, including tab (persona cycle), ctrl+s, shift+tab, F2, ctrl+n, ctrl+w, ctrl+[/ctrl+], and escape. Since #4044 is the more complete and actionable tracking issue that subsumes this one, closing this narrower issue. Please track the fix in #4044.


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

**Superseded by #4044** This issue specifically covers the missing `tab` key binding for persona cycling. Issue #4044 is a comprehensive tracking issue covering ALL missing TUI key bindings, including `tab` (persona cycle), `ctrl+s`, `shift+tab`, `F2`, `ctrl+n`, `ctrl+w`, `ctrl+[`/`ctrl+]`, and `escape`. Since #4044 is the more complete and actionable tracking issue that subsumes this one, closing this narrower issue. Please track the fix in #4044. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
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#3981
No description provided.