fix(clients): honor project default models in new threads - #6011
fix(clients): honor project default models in new threads#6011anirudhsama wants to merge 6 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:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes model resolution and draft persistence across web and mobile, adding explicit-selection tracking, sticky model storage, storage migration, and new cleanup and hydration behavior. Because these cross-cutting changes affect which models new threads use and how drafts survive reloads, the scope exceeds a straightforward bug fix. You can add or adjust custom eligibility rules. Learn more. |
|
I reproduced the desktop/web upgrade edge case that is not covered by this patch yet. Environment: macOS desktop The Suggested follow-up in this PR:
This is the desktop/web equivalent of the stale mobile-draft review finding, and it is observable in a released desktop build—not just a theoretical upgrade case. |
061251d to
626ef33
Compare
626ef33 to
6d3c1dd
Compare
6d3c1dd to
5500e58
Compare
5500e58 to
946268c
Compare
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.
Reviewed by Cursor Bugbot for commit 946268c. Configure here.

Closes #5796
Problem
Projects with a configured default model did not reliably start fresh drafts with it. Web wrote the currently viewed thread or globally sticky model before the project fallback could apply. Mobile retained a project-local override after submission, so it also continued to beat a configured default.
Fix
Both clients now use the same fresh-draft precedence:
Web and desktop resolve the target project's configured model before carried/sticky state. Mobile now separates the unsent draft override from an app-wide persisted sticky selection and clears only the draft-local model after successful submission. Dismissing an unsent draft still preserves its explicit choice; switching to another project does not let that choice beat the other project's configured default.
Validation
vp lint apps/web/src/hooks/useHandleNewThread.tsvp test run apps/web/src/composerDraftStore.test.ts(76 tests)vp run --filter @t3tools/web typecheckvp test run apps/mobile/src/state/use-composer-drafts.test.ts apps/mobile/src/lib/modelOptions.test.ts apps/mobile/src/features/threads/new-task-project-selection.test.ts(23 tests)vp run --filter @t3tools/mobile typecheckBuilt with GPT-5.6-Sol through the Codex harness in T3 Code.
Note
Medium Risk
Touches persisted composer state on both clients (storage v9 migration and mobile draft file semantics); incorrect precedence or migration could change which model users see on new threads, but behavior is heavily tested and scoped to draft seeding—not send/runtime model binding.
Overview
Aligns web and mobile so fresh new-thread / new-task composers resolve models in the same order: unsent draft pick → project default → app-wide sticky → provider default, instead of letting carried or draft-local state beat a configured project model.
Web adds
modelSelectionExpliciton composer drafts so only real picker/trait edits block re-seeding; new-thread flow usesresolveNewThreadModelSelectionOverride(project default over carried model, no self-carry). Storage bumps to v9 and strips non-explicit model seeds from empty draft sessions on upgrade;applyStickyStatereplaces stale seeded models.Mobile persists a global sticky model alongside drafts, uses
resolveNewTaskModelSelectionin the new-task flow, updates sticky on manual model changes, and after a successful send clears draft-local model and workspace so the next task re-resolves defaults. Composer draft persistence waits for hydration before writing to avoid clobbering disk.Reviewed by Cursor Bugbot for commit d7a5d31. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Honor project default models in new threads via explicit selection tracking
modelSelectionExplicitflag on composer drafts to distinguish user-picked model selections from seeded defaults. Picker writes and trait edits mark the draft explicit; seed writes do not.stickyComposerModelSelectionAtomandsetStickyComposerModelSelection, persisted alongside drafts. User model changes in the new-task flow update the sticky selection.COMPOSER_DRAFT_STORAGE_VERSIONto 9 on web). Receipt-only drafts and drafts with content or explicit picks are preserved.composerDraftStore.applyStickyStatenow replaces non-explicit draft model selections (including options) with sticky state and may clear the draft entirely if sticky is empty and the draft only carried a non-explicit selection. Reviewers should verifyapplyStickyStateandstripLegacyModelSeedsFromEmptyDraftSessionsin composerDraftStore.ts against any consumers expecting seeded models to survive.Macroscope summarized d7a5d31.