BUG-HUNT: [error-handling] ActorSelectionOverlay.confirm() result is never connected to _complete_first_run() — first-run actor selection silently no-ops, no default persona is ever created #6606

Open
opened 2026-04-09 22:11:24 +00:00 by HAL9000 · 0 comments
Owner

Bug Report: Error Handling — First-Run Actor Selection is Completely Disconnected

Severity Assessment

  • Impact: On a fresh install with no personas configured, the first-run actor selection overlay appears but selecting an actor does nothing. _complete_first_run() is never called, no default persona is ever saved, and every subsequent TUI launch re-enters the first-run flow. The user is permanently stuck in the first-run loop and can never use the TUI with a configured persona.
  • Likelihood: High — affects every new user on first launch.
  • Priority: Critical

Location

  • File: src/cleveragents/tui/app.py
  • Function/Class: _TextualCleverAgentsTuiApp._complete_first_run (line 140), on_mount (line 123)
  • Also: src/cleveragents/tui/widgets/actor_selection_overlay.pyActorSelectionOverlay.confirm() (entire class)

Description

_TextualCleverAgentsTuiApp defines a _complete_first_run() method intended to be called after the user selects an actor in the first-run overlay:

# app.py
def _complete_first_run(self, actor: str) -> None:
    """Persist the chosen actor as the default persona and refresh the bar."""
    create_default_persona_for_actor(self._persona_state.registry, actor)
    self._refresh_persona_bar()

The method exists and is correct. However, it is never called from anywhere in the codebase.

ActorSelectionOverlay does not define:

  • Any Textual Message subclass to post to the parent app
  • Any Textual BINDINGS for keyboard handling
  • Any Textual event handlers (on_key, on_press, etc.)
  • Any mechanism to communicate the confirmed actor back to the app
# actor_selection_overlay.py
class ActorSelectionOverlay(_StaticBase):
    # No Message class
    # No BINDINGS
    # No Textual event handlers

    def confirm(self) -> str | None:
        """Confirm the currently highlighted actor."""
        if not self._filtered_actors:
            return None
        actor = self._filtered_actors[self._selected_index]
        self._selected_actor = actor
        self._confirmed = True
        self.hide()
        return actor   # ← return value goes nowhere; no message posted to app

The app's on_mount correctly detects the first-run condition and calls actor_overlay.show(), but pressing Enter in the overlay has no observable effect because:

  1. No keyboard binding is defined on the overlay
  2. confirm() returns the actor but does not notify the parent app
  3. The app has no handler for overlay events because no message type is defined

Expected Behavior

When the user selects an actor and presses Enter in the first-run overlay, _complete_first_run(actor) should be called, which persists the default persona and hides the overlay.

Actual Behavior

The first-run overlay renders but is entirely non-functional. All keyboard input is ignored. No persona is ever created. Every TUI launch starts in first-run mode.

Suggested Fix

  1. Add a Textual Message class to ActorSelectionOverlay:
class ActorSelected(Message):
    """Posted when the user confirms an actor selection."""
    def __init__(self, actor: str) -> None:
        super().__init__()
        self.actor = actor
  1. Post the message from confirm():
def confirm(self) -> str | None:
    if not self._filtered_actors:
        return None
    actor = self._filtered_actors[self._selected_index]
    self._selected_actor = actor
    self._confirmed = True
    self.hide()
    self.post_message(ActorSelectionOverlay.ActorSelected(actor))
    return actor
  1. Add a handler in the app:
def on_actor_selection_overlay_actor_selected(
    self, event: ActorSelectionOverlay.ActorSelected
) -> None:
    self._complete_first_run(event.actor)

Category

error-handling

TDD Note

After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: @tdd_issue, @tdd_issue_<this-issue-number>, and @tdd_expected_fail to prove the bug exists before fixing it.


Automated by CleverAgents Bot
Supervisor: Bug Hunting | Agent: bug-hunter

## Bug Report: Error Handling — First-Run Actor Selection is Completely Disconnected ### Severity Assessment - **Impact**: On a fresh install with no personas configured, the first-run actor selection overlay appears but selecting an actor does nothing. `_complete_first_run()` is never called, no default persona is ever saved, and every subsequent TUI launch re-enters the first-run flow. The user is permanently stuck in the first-run loop and can never use the TUI with a configured persona. - **Likelihood**: High — affects every new user on first launch. - **Priority**: Critical ### Location - **File**: `src/cleveragents/tui/app.py` - **Function/Class**: `_TextualCleverAgentsTuiApp._complete_first_run` (line 140), `on_mount` (line 123) - **Also**: `src/cleveragents/tui/widgets/actor_selection_overlay.py` — `ActorSelectionOverlay.confirm()` (entire class) ### Description `_TextualCleverAgentsTuiApp` defines a `_complete_first_run()` method intended to be called after the user selects an actor in the first-run overlay: ```python # app.py def _complete_first_run(self, actor: str) -> None: """Persist the chosen actor as the default persona and refresh the bar.""" create_default_persona_for_actor(self._persona_state.registry, actor) self._refresh_persona_bar() ``` The method exists and is correct. However, it is **never called** from anywhere in the codebase. `ActorSelectionOverlay` does not define: - Any Textual `Message` subclass to post to the parent app - Any Textual `BINDINGS` for keyboard handling - Any Textual event handlers (`on_key`, `on_press`, etc.) - Any mechanism to communicate the confirmed actor back to the app ```python # actor_selection_overlay.py class ActorSelectionOverlay(_StaticBase): # No Message class # No BINDINGS # No Textual event handlers def confirm(self) -> str | None: """Confirm the currently highlighted actor.""" if not self._filtered_actors: return None actor = self._filtered_actors[self._selected_index] self._selected_actor = actor self._confirmed = True self.hide() return actor # ← return value goes nowhere; no message posted to app ``` The app's `on_mount` correctly detects the first-run condition and calls `actor_overlay.show()`, but pressing Enter in the overlay has no observable effect because: 1. No keyboard binding is defined on the overlay 2. `confirm()` returns the actor but does not notify the parent app 3. The app has no handler for overlay events because no message type is defined ### Expected Behavior When the user selects an actor and presses Enter in the first-run overlay, `_complete_first_run(actor)` should be called, which persists the default persona and hides the overlay. ### Actual Behavior The first-run overlay renders but is entirely non-functional. All keyboard input is ignored. No persona is ever created. Every TUI launch starts in first-run mode. ### Suggested Fix 1. Add a Textual `Message` class to `ActorSelectionOverlay`: ```python class ActorSelected(Message): """Posted when the user confirms an actor selection.""" def __init__(self, actor: str) -> None: super().__init__() self.actor = actor ``` 2. Post the message from `confirm()`: ```python def confirm(self) -> str | None: if not self._filtered_actors: return None actor = self._filtered_actors[self._selected_index] self._selected_actor = actor self._confirmed = True self.hide() self.post_message(ActorSelectionOverlay.ActorSelected(actor)) return actor ``` 3. Add a handler in the app: ```python def on_actor_selection_overlay_actor_selected( self, event: ActorSelectionOverlay.ActorSelected ) -> None: self._complete_first_run(event.actor) ``` ### Category error-handling ### TDD Note After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: `@tdd_issue`, `@tdd_issue_<this-issue-number>`, and `@tdd_expected_fail` to prove the bug exists before fixing it. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunting | Agent: bug-hunter
HAL9000 added this to the v3.2.0 milestone 2026-04-09 22:25:27 +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.

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