fix(web): auto-enable default thinking effort when switching to an effort-capable model#1475
fix(web): auto-enable default thinking effort when switching to an effort-capable model#1475wbxl2000 wants to merge 2 commits into
Conversation
…fort-capable model
🦋 Changeset detectedLatest commit: 841b79c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39063024c3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const prevModel = sid === undefined ? undefined : rawState.sessions.find((s) => s.id === sid)?.model; | ||
| const isSwitch = prevModel !== modelId; |
There was a problem hiding this comment.
Preserve draft selections when detecting model switches
When there is no active session (the new-session/onboarding composer), prevModel is always undefined even though the current picker value comes from draftModel or rawState.defaultModel. If the user has thinking set to off and clicks the already-current effort-capable model in the full picker, isSwitch becomes true and the next line auto-enables the model's default effort, so simply re-selecting the current draft/default model silently changes the thinking level for the first prompt instead of preserving off.
Useful? React with 👍 / 👎.
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 841b79cdc5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const prevModel = sid === undefined ? undefined : rawState.sessions.find((s) => s.id === sid)?.model; | ||
| const isSwitch = prevModel !== modelId; |
There was a problem hiding this comment.
Compare against the effective current model
Here prevModel is undefined in the new-session draft state, and can also be empty when a session relies on the daemon default model, even though the picker/status treats draftModel ?? defaultModel as the current selection. In those cases, clicking the already-selected effort-capable model while thinking is off makes isSwitch true and thinkingLevelForModelSwitch turns thinking back on, so re-selecting the current model no longer preserves off. Derive isSwitch from the effective current model used for display/coercion, not only from session.model.
Useful? React with 👍 / 👎.
Related Issue
Follow-up to #1344
Problem
After #1344, the web composer shows multi-level thinking effort controls for effort-capable models, but switching to such a model from a model with thinking "off" leaves thinking disabled. The TUI model picker instead pre-selects the target model's default effort, so the user immediately sees the effort control.
What changed
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.