fix(web): new threads keep the viewed thread's model - #8892
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:
Warning Your free Security trial is over. An organization admin can activate Security or dismiss this notice. Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — New threads will now favor the viewed thread’s model over the configured project default whenever both are available, changing the product’s effective default-selection behavior. The change is localized and tested, but that default-policy change warrants human review. You can add or adjust custom eligibility rules. Learn more. |
Since #6011 the project default model outranks the model carried from the thread being viewed. Every project gets a default seeded at creation (the first selectable provider's default), so in practice a new thread always reset to that model instead of keeping the one the user was working with. Runtime and interaction modes still carried; only the model was lost.
This flips the priority in
resolveNewThreadModelSelectionOverride: the carried selection wins, and the project default only fills in when there is nothing to carry (fresh app, or the draft would carry from itself). Mobile is unaffected since its new-task flow has no viewed-thread carry.Validation
vp test run apps/web/src/lib/chatThreadActions.test.ts(10 tests)vp fmt --checkandvp linton the touched filesvp run --filter @t3tools/web typecheckBuilt with Claude Fable 5 in Claude Code.
Note
Low Risk
Localized priority change in new-thread model resolution with updated unit tests; no auth, data, or API surface changes.
Overview
New-thread model selection no longer resets to the project default when the user was already working with a different model on the thread they were viewing.
resolveNewThreadModelSelectionOverridenow prefers the carried composer/thread model over the project default (which is always seeded at project creation). The project default is only applied when there is nothing to carry—e.g. cold start or when the destination draft would carry from itself. Comments inuseHandleNewThreadare updated to match.Tests are updated and extended to assert carried-over-wins, plus fallback to project default when carry is absent.
Reviewed by Cursor Bugbot for commit 759df78. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
resolveNewThreadModelSelectionOverrideto prefer carried model over project defaultresolveNewThreadModelSelectionOverride: it returns the carried selection when present, and falls back to the project default only when there is nothing to carry (including when source and destination draft IDs match).resolveNewThreadModelSelectionOverrideno longer lets the project default override a carried selection; consumers relying on the old order will see carried selections win.Macroscope summarized 759df78.