Skip to content

Show the reasoning level of the running turn - #777

Open
uvforce wants to merge 2 commits into
agegr:mainfrom
uvforce:pr/streaming-thinking-level
Open

Show the reasoning level of the running turn#777
uvforce wants to merge 2 commits into
agegr:mainfrom
uvforce:pr/streaming-thinking-level

Conversation

@uvforce

@uvforce uvforce commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Problem

The reasoning level control is hidden while a turn is streaming, because the level cannot be changed mid-turn. That also removes the answer to the question that matters most at exactly that moment: which budget is this turn spending. A long-running turn gives no indication of whether it is on auto, low, or xhigh, and the level is only visible again once the turn is over.

Change

While streaming, the control row shows the active level as a read-only label in the same slot the dropdown normally occupies. Nothing else about the streaming controls changes.

It is deliberately not a button: the level cannot be changed until the turn ends, so a clickable control there would invite clicks that do nothing. The label reuses thinkingDisplayLabel, the existing ThinkingIcon, and the same padding, height, and mobile collapse rule as the editable control, so the row keeps its spacing next to Stop.

Tests

  • components/ChatInput.streaming-thinking.test.mjs — the streaming branch renders the level without any button or click handler, and shares padding, height, and the mobile collapse rule with the dropdown.
  • Full npm test (952), tsc --noEmit, eslint, and next build pass.
  • Verified in a production build with a real browser: during a streaming turn the level appears next to Stop, and the editable dropdown returns unchanged once the turn ends.

The reasoning control is hidden while a turn streams because the level
cannot be changed mid-turn. That also hides the level itself, exactly when
it decides how long the turn runs and how much budget it spends.

Render the active level as a read-only label in the same slot while
streaming. It is not a button: nothing can change until the turn ends, so
a clickable control would only invite clicks that do nothing. The label
reuses the existing display label, icon, padding, height, and mobile
collapse rule, so the control row keeps its spacing next to Stop.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T09:15:03.615619Z bf76138 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf76138402

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/ChatInput.tsx
// would invite clicks that do nothing. It still answers the question
// that matters while a turn runs, which budget is this one spending.
<span
title={t("chat.currentReasoning", { level: thinkingDisplayLabel })}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show the effective reasoning level instead of auto

When an existing session previously used an explicit level and the user selects “Use pi default,” handleThinkingLevelChange sets the client state to auto but returns without updating the runtime, so the agent retains the previous level. On the next prompt this new badge therefore reports auto as the current turn's level even though, for example, high is actually being used. Capture or synchronize the runtime's effective level when the turn starts rather than rendering the selector state directly.

Useful? React with 👍 / 👎.

Choosing "Use pi default" sets the selector to "auto" without touching the
runtime, so the runtime can keep an earlier explicit level. Rendering the
selector state while streaming would then label a turn "auto" that is in
fact running at, say, "high".

When a turn starts, read the runtime's thinking level from the agent state
and adopt it, so the read-only label and the selector both reflect the
level in effect. The lookup is skipped if the turn has already ended.
@uvforce

uvforce commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Addressed in 37b6553. When a turn starts, the client reads the runtime's thinking level from the agent state and adopts it, so the label reports the level actually in effect even after "Use pi default" left an earlier explicit level in place. The dropdown reflects the same value once the turn ends.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant