fix(agents): show reasoning effort button for agent session reasoning models#13569
Open
fix(agents): show reasoning effort button for agent session reasoning models#13569
Conversation
… models InputbarTools used useAssistant(assistantId) to resolve the model, but agent session IDs don't exist in the Redux assistants store. This caused the model to fall back to the global defaultModel, which is typically not a reasoning model, so the thinking tool's condition check (isReasoningModel) failed and the button was filtered out. Fix by passing assistant and model as props from the caller, which already has the correct data, instead of having InputbarTools fetch internally via useAssistant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
EurFelux
approved these changes
Mar 18, 2026
Contributor
There was a problem hiding this comment.
The latest update addresses the non-null assertion concern cleanly. AgentSessionInputbar now passes assistant.model without forcing !, and InputbarTools accepts an optional model override while falling back to assistant.model internally. That keeps the original fix intact for agent-session reasoning models without introducing a new runtime hazard. I do not see any remaining blocking issues in the current patch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Before this PR:
When selecting a reasoning model (e.g., Claude with extended thinking, o3) in an agent session, the reasoning effort / thinking button was invisible — users could not configure thinking intensity.
After this PR:
The reasoning effort button correctly appears for reasoning models in agent sessions, matching the behavior in normal chat.
Why we need it and why it was done in this way
Root cause:
InputbarToolsinternally calleduseAssistant(assistantId)to resolve the assistant and model. For agent sessions, theassistantIdis an agent ID that doesn't exist in the Reduxstate.assistants.assistantsarray. This caused:assistantresolved toundefined(cast asAssistant)modelfell back to the globaldefaultModel(e.g., gpt-4o)condition: isReasoningModel(model)returnedfalseavailableToolsentirelyThe fix: Pass
assistantandmodelas props from the caller (which already has the correct data) instead of havingInputbarToolsfetch them internally viauseAssistant.The following tradeoffs were made:
useAssistantfromInputbarTools, making it a controlled component that relies on the caller to provide assistant/model data. This is a minor interface change but makes the component more predictable and reusable.The following alternatives were considered:
Add
modelOverrideprop as a fallback — Would keepuseAssistantas the primary source and only override when needed. Rejected because it's a band-aid that doesn't address the root cause:useAssistantis being called with an ID that fundamentally cannot exist in Redux for agent sessions.Dispatch agent assistant stub into Redux store — Would make
useAssistant(agentId)find the assistant naturally. Rejected because:type-based filtering exists)redux-persist, polluting storageuseAssistant'suseEffectwould sync reasoning effort settings back to Redux, conflicting with agent session's local state managementPass props from caller (chosen approach) — The simplest fix. Both callers (
InputbarandAgentSessionInputbar) already have the correctassistantandmodel. Three files changed, ~9 lines added / ~7 removed.Breaking changes
None. Internal component interface change only —
InputbarToolsis not exported as a public API.Special notes for your reviewer
The
assistantIdprop was removed fromInputbarToolsNewPropssinceassistant.idprovides the same information. No external consumers exist.Checklist
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note