Skip to content

[Bug] Question tool can block a session without showing the question UI #419

@Astro-Han

Description

@Astro-Han

What happened?

The question tool can be invoked and block the assistant flow, but the visible question UI does not appear in the session composer. From the user's perspective the app looks stuck: the assistant is waiting for a decision, but there is no clickable question dock.

Observed in a live session:

  • session: ses_2114b1086ffe7s2HnOL1qN4Etk
  • part: prt_df0f9b38d001Yzdvnl3gXs8Ef1
  • tool: question
  • callID: call_XM0zEOODHkyWkFe8wzeo7hhq
  • final state: error
  • error: Tool execution aborted
  • input contained a valid question with three options:
    • Fix stale part
    • Directly edit binding
    • Do nothing yet

The user never saw the question dock and had to answer manually in chat. This appears similar to a previous attempted fix for invisible question blockers, but this path is still not covered.

Area: App flow or product behavior; Model harness, prompts, tools, or session mechanics

Impact: Blocks an important workflow / can make the session look frozen

Steps to reproduce

  1. In a PawWork session, invoke the question tool with 2-4 valid options.
  2. Have the assistant wait for the user decision.
  3. Observe that the tool call exists in persisted parts, but the session composer does not show SessionQuestionDock.
  4. The user sees no actionable UI and the session appears stuck.

This has been observed once in the current session. It may require an event delivery/race condition where question.asked does not populate sync.data.question, and the fallback refetch does not surface a visible dock in time.

What did you expect to happen?

Whenever a question tool blocks assistant progress, the UI should show a visible, actionable question dock. If the event is missed, the fallback should recover from the running question tool part and fetch pending questions. If recovery is in progress or fails, the UI should show a clear visible state instead of looking frozen.

PawWork version

2026.5.4

OS version

macOS 26.3.1

Can you reproduce it again?

Only once so far

Diagnostics

Relevant current code paths:

  • packages/opencode/src/question/index.ts
    • Question.ask() publishes question.asked and waits on a deferred reply.
  • packages/app/src/context/global-sync/event-reducer.ts
    • question.asked should populate store.question[sessionID].
  • packages/app/src/pages/session/blockers/use-session-blockers.ts
    • questionRequest() reads from sync.data.question.
    • questionFallbackSessionID() only tries to recover when a recent running question tool exists.
  • packages/app/src/pages/session/blockers/question-fallback.ts
    • fallback only scans the last 5 messages for a running question tool part.
  • packages/app/src/pages/session/composer/session-composer-region.tsx
    • SessionQuestionDock renders only when props.state.questionRequest() is truthy.

Possible failure modes to investigate:

  1. question.asked event was missed or not applied to sync.data.question.
  2. The fallback lookback or trigger did not catch the running question part.
  3. The pending question existed server-side but was not fetched into the active child store.
  4. There is no visible recovering/error state while a question tool is running but no request is available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priorityappApplication behavior and product flowsbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions