Show the reasoning level of the running turn - #777
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| // 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 })} |
There was a problem hiding this comment.
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.
|
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. |
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, orxhigh, 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 existingThinkingIcon, 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.npm test(952),tsc --noEmit,eslint, andnext buildpass.