Skip to content

v0.9.14: unanswered user-input prompts stick in pending_user_inputs forever when their turn dies without the terminal settle #6275

Description

@Hmbown

Why this matters

pending_user_inputs is the engine→user question surface that runtime clients render (the GPUI app turns it into a question sheet and hides the pet). An entry whose turn dies through a path that skips settle_user_inputs_for_terminal_turn never settles: it renders forever, and repeated prompts accumulate — the user sees "stuck pending inputs" they cannot clear except by answering a question the turn is no longer waiting for.

Current behavior

  • crates/tui/src/runtime_threads.rs:11684EngineEvent::UserInputRequired registers the entry.
  • Settlement paths: user answers (submit_user_input route) or settle_user_inputs_for_terminal_turn at runtime_threads.rs:6510, :8705, :12004.
  • Turns that end through interrupt/cancel/failure paths which skip those three call sites leak their entries. The map is in-memory, so a leaked entry also survives until process restart.

Repro (live)

This session (GPUI client): plugin-install prompts fired by the overactive matcher (#6274) parked as pending user inputs; after the underlying turns ended the prompts remained rendered and further inputs kept arriving. Session record: ~/.codewhale/sessions/6453856f-10b5-4a9b-947c-dcac902071d3.json.

Desired behavior

  1. Every turn-death path (complete, interrupt, cancel, failure) settles that turn's pending user inputs with user_input.canceled events — no path may leave an entry.
  2. claim_pending_user_inputs_for_turn bailing on indeterminate entries should stay loud, but indeterminate entries must also be resolvable, not permanent.

Acceptance criteria

  • Regression test: a turn with an outstanding user-input request that ends via the interrupt path emits user_input.canceled and leaves pending_user_inputs empty for that thread
  • No call path from EngineEvent::TurnComplete/interrupt handling to a terminal state can skip the settle (assertion or exhaustive audit note in the PR)
  • Focused cargo test -p codewhale-tui --lib --locked green for runtime_threads/runtime_api tests

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreliabilityReliability, flaky behavior, retries, fallbacks, and robustness

    Projects

    • Status
      In progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions