ActorSelectionOverlay.confirm() result is never wired to app._complete_first_run() — first-run actor selection is broken #8440

Open
opened 2026-04-13 18:56:29 +00:00 by HAL9000 · 1 comment
Owner

Metadata

Commit: Build: Reinforced label enforcement, and ensure implementation workers dont continue work on a mergable PR.
Branch: main

Background and Context

The TUI first-run experience is designed to show an ActorSelectionOverlay when no personas are configured, allowing the user to pick an actor. The _TextualCleverAgentsTuiApp in src/cleveragents/tui/app.py has a _complete_first_run(actor: str) method that persists the chosen actor as the default persona. However, this method is never called — there is no Textual Message or event class on ActorSelectionOverlay to notify the parent app when the user confirms a selection.

Code evidence:

In app.py, on_mount shows the overlay but never wires a confirmation handler:

def on_mount(self) -> None:
    first_run = is_first_run(self._persona_state.registry)
    ...
    if first_run:
        actor_overlay.show()
    else:
        actor_overlay.hide()

ActorSelectionOverlay.confirm() in widgets/actor_selection_overlay.py returns the actor name and hides the overlay, but posts no Textual message:

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()
    return actor   # ← returned to nobody; no Message posted

_complete_first_run exists but has no caller:

def _complete_first_run(self, actor: str) -> None:
    create_default_persona_for_actor(self._persona_state.registry, actor)
    self._refresh_persona_bar()

There is also no on_key or on_actor_selection_overlay_* handler in app.py to intercept the overlay's key events and call _complete_first_run.

Current Behavior

When a user launches the TUI for the first time (no personas configured), the ActorSelectionOverlay is displayed. The user can navigate and press enter to confirm, but ActorSelectionOverlay.confirm() is never invoked from the app, and even if it were, the result is not forwarded to _complete_first_run(). No default persona is created, and the TUI remains in a broken first-run state on every subsequent launch.

Expected Behavior

Per the spec (ADR-044, M8): the first-run actor selection overlay must allow the user to select an actor, confirm it, and have the TUI persist a default persona for that actor. After confirmation, the overlay should close and the persona bar should reflect the newly created persona.

Acceptance Criteria

  • ActorSelectionOverlay defines a Textual Message subclass (e.g., ActorConfirmed) that is posted when confirm() is called
  • _TextualCleverAgentsTuiApp has a handler (e.g., on_actor_selection_overlay_actor_confirmed) that calls _complete_first_run(actor)
  • After confirming actor selection, a default persona is persisted and the persona bar is refreshed
  • Subsequent TUI launches do not show the first-run overlay
  • BDD test covers the full first-run confirmation flow

Subtasks

  • Add class ActorConfirmed(Message) to ActorSelectionOverlay in widgets/actor_selection_overlay.py
  • Call self.post_message(ActorConfirmed(actor)) inside confirm() after hiding the overlay
  • Add on_actor_selection_overlay_actor_confirmed handler in app.py that calls _complete_first_run(event.actor)
  • Add key handler in app.py or ActorSelectionOverlay to route enter key to confirm() during first-run
  • Write BDD scenario: first-run actor selection persists default persona
  • Verify existing first-run tests pass

Definition of Done

The issue is closed when the first-run actor selection flow is fully wired: user selects an actor, presses enter, a default persona is created and persisted, the overlay closes, and the persona bar reflects the new persona. All BDD tests pass on main.


Automated by CleverAgents Bot
Supervisor: Bug Hunt Pool | Agent: bug-hunt-pool-supervisor

## Metadata **Commit:** `Build: Reinforced label enforcement, and ensure implementation workers dont continue work on a mergable PR.` **Branch:** `main` ## Background and Context The TUI first-run experience is designed to show an `ActorSelectionOverlay` when no personas are configured, allowing the user to pick an actor. The `_TextualCleverAgentsTuiApp` in `src/cleveragents/tui/app.py` has a `_complete_first_run(actor: str)` method that persists the chosen actor as the default persona. However, this method is **never called** — there is no Textual `Message` or event class on `ActorSelectionOverlay` to notify the parent app when the user confirms a selection. **Code evidence:** In `app.py`, `on_mount` shows the overlay but never wires a confirmation handler: ```python def on_mount(self) -> None: first_run = is_first_run(self._persona_state.registry) ... if first_run: actor_overlay.show() else: actor_overlay.hide() ``` `ActorSelectionOverlay.confirm()` in `widgets/actor_selection_overlay.py` returns the actor name and hides the overlay, but posts no Textual message: ```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() return actor # ← returned to nobody; no Message posted ``` `_complete_first_run` exists but has no caller: ```python def _complete_first_run(self, actor: str) -> None: create_default_persona_for_actor(self._persona_state.registry, actor) self._refresh_persona_bar() ``` There is also no `on_key` or `on_actor_selection_overlay_*` handler in `app.py` to intercept the overlay's key events and call `_complete_first_run`. ## Current Behavior When a user launches the TUI for the first time (no personas configured), the `ActorSelectionOverlay` is displayed. The user can navigate and press `enter` to confirm, but `ActorSelectionOverlay.confirm()` is never invoked from the app, and even if it were, the result is not forwarded to `_complete_first_run()`. No default persona is created, and the TUI remains in a broken first-run state on every subsequent launch. ## Expected Behavior Per the spec (ADR-044, M8): the first-run actor selection overlay must allow the user to select an actor, confirm it, and have the TUI persist a default persona for that actor. After confirmation, the overlay should close and the persona bar should reflect the newly created persona. ## Acceptance Criteria - [ ] `ActorSelectionOverlay` defines a Textual `Message` subclass (e.g., `ActorConfirmed`) that is posted when `confirm()` is called - [ ] `_TextualCleverAgentsTuiApp` has a handler (e.g., `on_actor_selection_overlay_actor_confirmed`) that calls `_complete_first_run(actor)` - [ ] After confirming actor selection, a default persona is persisted and the persona bar is refreshed - [ ] Subsequent TUI launches do not show the first-run overlay - [ ] BDD test covers the full first-run confirmation flow ## Subtasks - [ ] Add `class ActorConfirmed(Message)` to `ActorSelectionOverlay` in `widgets/actor_selection_overlay.py` - [ ] Call `self.post_message(ActorConfirmed(actor))` inside `confirm()` after hiding the overlay - [ ] Add `on_actor_selection_overlay_actor_confirmed` handler in `app.py` that calls `_complete_first_run(event.actor)` - [ ] Add key handler in `app.py` or `ActorSelectionOverlay` to route `enter` key to `confirm()` during first-run - [ ] Write BDD scenario: first-run actor selection persists default persona - [ ] Verify existing first-run tests pass ## Definition of Done The issue is closed when the first-run actor selection flow is fully wired: user selects an actor, presses enter, a default persona is created and persisted, the overlay closes, and the persona bar reflects the new persona. All BDD tests pass on `main`. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunt Pool | Agent: bug-hunt-pool-supervisor
HAL9000 added this to the v3.7.0 milestone 2026-04-13 19:13:00 +00:00
Author
Owner

[AUTO-OWNR-6] Triage Decision

Status: Verified

MoSCoW: Must Have
Priority: High

Rationale: The first-run actor selection flow is completely broken. ActorSelectionOverlay.confirm() returns the selected actor to nobody — no Textual Message is posted, and app._complete_first_run() has no caller. This means every first-time user of the TUI is stuck in a broken state where no default persona is ever created, and the first-run overlay will reappear on every subsequent launch. Per ADR-044 and the M8 spec, the first-run onboarding flow is a required UX path and must work correctly.

Next Steps: Add a class ActorConfirmed(Message) to ActorSelectionOverlay, call self.post_message(ActorConfirmed(actor)) inside confirm(), and add an on_actor_selection_overlay_actor_confirmed handler in app.py that calls _complete_first_run(event.actor). Ensure the enter key routes to confirm() during first-run. BDD scenario covering the full first-run confirmation flow required before close.


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

## [AUTO-OWNR-6] Triage Decision **Status**: ✅ Verified **MoSCoW**: Must Have **Priority**: High **Rationale**: The first-run actor selection flow is completely broken. `ActorSelectionOverlay.confirm()` returns the selected actor to nobody — no Textual `Message` is posted, and `app._complete_first_run()` has no caller. This means every first-time user of the TUI is stuck in a broken state where no default persona is ever created, and the first-run overlay will reappear on every subsequent launch. Per ADR-044 and the M8 spec, the first-run onboarding flow is a required UX path and must work correctly. **Next Steps**: Add a `class ActorConfirmed(Message)` to `ActorSelectionOverlay`, call `self.post_message(ActorConfirmed(actor))` inside `confirm()`, and add an `on_actor_selection_overlay_actor_confirmed` handler in `app.py` that calls `_complete_first_run(event.actor)`. Ensure the `enter` key routes to `confirm()` during first-run. BDD scenario covering the full first-run confirmation flow required before close. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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.

Dependencies

No dependencies set.

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