[PR #12997] feat(tui): show thinking indicator when reasoning is hidden #14471

Open
opened 2026-02-16 18:19:15 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12997

State: open
Merged: No


What does this PR do?

Closes #12028

When thinking visibility is toggled off (/thinking), the TUI previously showed nothing during the reasoning phase. This made it impossible to tell whether the model was actively thinking or stalled.

This changes the ReasoningPart component to render a collapsed single-line spinner (⠹ Thinking...) when thinking is hidden and reasoning is in progress. It uses the same braille spinner pattern as tools and subagents for visual consistency. The indicator disappears when reasoning finishes or the session is interrupted (esc 2x).

When thinking visibility is on, behavior is unchanged (full reasoning block renders as before).

image

Second screenshot shows the thinking line disappearing once reasoning is finished:

image

How did you verify your code works?

  • Ran bun dev with a thinking model (Claude Sonnet), toggled /thinking off, sent a prompt, and confirmed the spinner appeared during reasoning and disappeared when text started streaming
  • Verified esc 2x interrupt stops the spinner
  • Toggled /thinking back on and confirmed full reasoning block renders normally
  • tsgo --noEmit passes clean
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12997 **State:** open **Merged:** No --- ### What does this PR do? Closes #12028 When thinking visibility is toggled off (`/thinking`), the TUI previously showed nothing during the reasoning phase. This made it impossible to tell whether the model was actively thinking or stalled. This changes the `ReasoningPart` component to render a collapsed single-line spinner (`⠹ Thinking...`) when thinking is hidden and reasoning is in progress. It uses the same braille spinner pattern as tools and subagents for visual consistency. The indicator disappears when reasoning finishes or the session is interrupted (esc 2x). When thinking visibility is on, behavior is unchanged (full reasoning block renders as before). <img width="1012" height="244" alt="image" src="https://github.com/user-attachments/assets/da3ae2df-07a5-4a18-8fa2-e88db231c8cd" /> Second screenshot shows the thinking line disappearing once reasoning is finished: <img width="1024" height="210" alt="image" src="https://github.com/user-attachments/assets/5657168d-745f-4a74-ac00-0ae976026d99" /> ### How did you verify your code works? - Ran `bun dev` with a thinking model (Claude Sonnet), toggled `/thinking` off, sent a prompt, and confirmed the spinner appeared during reasoning and disappeared when text started streaming - Verified esc 2x interrupt stops the spinner - Toggled `/thinking` back on and confirmed full reasoning block renders normally - `tsgo --noEmit` passes clean
yindo added the pull-request label 2026-02-16 18:19:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14471