fix(web): new threads honor the project default model - #7515
fix(web): new threads honor the project default model#7515eggfriedrice24 wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes runtime behavior for model selection in new threads, making project default models take precedence over carried models from previously viewed threads. This is a user-facing behavior change that warrants human verification of the intended prioritization logic. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 119ffac. Configure here.
| // The selection is a complete snapshot of the pinned or viewed | ||
| // model state: absent options mean "no options", not "keep the | ||
| // stale draft's options". | ||
| setModelSelection(emptyStoredDraftThread.draftId, modelSelectionOverride, { |
There was a problem hiding this comment.
Pin skipped on open empty draft
Medium Severity
modelSelectionOverride is only written on the empty-stored path when workspaceContext is set. An already-open empty draft with no explicit workspace options leaves that context null, so a new-thread request does not apply the project pin. The viewed-draft reuse path does apply it, but that path is skipped whenever the stored empty draft is the one on screen — the usual sidebar or hotkey new-thread case while sitting on that draft.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 119ffac. Configure here.
There was a problem hiding this comment.
True, and intentional: this keeps the path's pre-existing semantics. When the request lands on the draft already on screen with no explicit workspace options, the handler leaves the draft alone entirely (the same guard skipped the carry write before this PR). The user may have just picked a model in that composer, and without an explicit-pick marker (#6593's approach) a reseed would clobber it. The remap path applies the pin because there the draft is being reassigned to the project. A stale draft heals on any new-thread request issued from outside it.
…rs-project-default
|
Hi @juliusmarminge @maria-rcks, sorry for the direct tag, I know you are both busy. This one is hitting our team's workflow pretty hard: we switch between subscriptions often, and new threads not honoring the project default model and subscription means everyone has to reselect them constantly. The branch is now up to date with main. Would really appreciate a look when you get a chance, and happy to adjust anything in the meantime. |
…rs-project-default


Fixes #5796
New threads on web/desktop seeded the composer from the global sticky last-used selection and the viewed thread, so a project's configured default model, including which provider instance (subscription), was ignored when switching projects.
Fix:
useNewThreadHandlerresolvesproject.defaultModelSelection ?? carryModelSelectionand applies it in all three draft seed paths. A configured project default beats sticky and carry; projects without one keep current behavior; explicit composer picks still win.Related: #6011 has the same web change bundled with a mobile rework; #6593 covers extra edge cases at (persisted flag, render-time overrides). This is the minimal web-only version. Supersedes #7511 (opened by mistake, closed).
Validation:
composerDraftStoretests (79 pass), web lint/typecheck clean, integrated pass with two Claude instances and opposite project pins: new threads land on the target project's pin in both directions, even with sticky and carry pointing at the other instance.Built with Claude Fable 5 through Claude Code in T3 Code.
Note
Medium Risk
Changes composer model initialization across every new-thread code path; wrong priority could mis-route provider subscriptions, but scope is limited to draft seeding in one hook.
Overview
New-thread seeding in
useHandleNewThreadnow resolvesmodelSelectionOverrideasproject.defaultModelSelection ?? carryModelSelection, so a project’s configured default model (including provider instance) wins over the globally sticky pick and the model carried from the thread you were viewing.That override is applied on all three draft paths—reusing an empty stored draft, reusing the current empty draft for the same logical project, and minting a fresh draft after
applyStickyState—viasetModelSelectionwithreplaceOptions: true. Projects without a default keep the previous sticky + carry behavior; composer-visible picks still feedcarryModelSelectionwhen no pin is set.Reviewed by Cursor Bugbot for commit cf79aa6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
useNewThreadHandlerto use project default model for new threadsdefaultModelSelectionwhen set; otherwise they fall back to the carried model selectionmodelSelectionOverridein useHandleNewThread.ts, replacing allsetModelSelectioncalls that previously usedcarryModelSelectionreplaceOptions: trueusing the same overrideMacroscope summarized cf79aa6.