GeezerVison is showing github.com — fix(web): new threads honor the project default model by efr-nox · Pull Request #7511 · pingdotgg/t3code
Conversation
efr-nox
commented
Aug 19, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #5796
Problem
A project's configured default model (Project settings) stores a full ModelSelection, including the provider instance, i.e. which subscription runs the thread. New threads on web/desktop ignored it: fresh drafts were seeded from the globally sticky last-used selection and from the thread being viewed, both of which follow recent activity across projects. Working in a project pinned to a work subscription and then opening a new thread in a project pinned to a personal one started the thread on the work account.
Fix
useNewThreadHandler now resolves one override, project.defaultModelSelection ?? carryModelSelection, and writes it wherever the handler previously wrote the carried selection: the mint-fresh path (after sticky state), the empty-stored-draft reuse path, and the viewed-draft reuse path. A configured project default acts as a pin: every new-thread request in that project starts on it, beating sticky and carry. Projects without a pin keep the existing sticky + carry behavior, and an explicit pick in the composer afterwards still wins for that draft because it writes the draft directly.
Why this shape
Two open PRs already target this bug; this one deliberately sits between them.
- fix(clients): honor project default models in new threads #6011 (thanks @anirudhsama) contains essentially this web change, but bundles a large mobile rework into the same PR. Mobile already resolves draft, then project default, then server default on its own, and repo convention is one concern per PR.
- fix(web): honor project default model on desktop new threads #6593 (thanks @mrmg) fixes the same flow plus edge cases: retroactive reseeding of stale persisted drafts, a new persisted
modelSelectionExplicit flag, render-time precedence overrides in ChatComposer/ChatView, and pin-clear sticky restore. That is ~1.2k lines across seven files for what is at its core a seeding-order bug, and the render-time override machinery introduces a second source of truth for what the composer displays versus what the draft stores.
This PR keeps the model small: the pin is applied once, at the moment a new-thread request seeds a draft. No schema changes, no new persisted flags, no render-time overrides. Drafts seeded before this fix heal on the next new-thread request in their project. What it deliberately does not cover: a stale unsent draft submitted without ever passing through a new-thread request again, and live re-sync of an open draft when the pin changes in Settings (the wider defaults story is #6539). If maintainers want those edges, #6593 is the thorough version and I am happy to close this in its favor.
Validation
vp test run apps/web/src/composerDraftStore.test.ts (79 tests pass)
vp lint apps/web/src/hooks/useHandleNewThread.ts and vp run --filter @t3tools/web typecheck (clean)
- Integrated web pass against a snapshot of a real database with two Claude instances (personal + Work) and opposite pins on two projects:
- viewing a Work-subscription thread in project A, then New thread into project B, lands on B's personal pin
- the reverse direction lands on the Work pin
- after an explicit Work / Claude Opus 5 pick (global sticky and carry both pointing at Work), New thread into project B still lands on B's pinned personal Claude Fable 5, reusing the stored empty draft correctly
No UI layout changes.
Built with Claude Fable 5 through Claude Code in T3 Code.
Note Medium Risk
Touches core new-thread draft seeding and model selection precedence; behavior change is localized to one hook but affects which provider/subscription every new thread starts on.
Overview
New-thread seeding now treats a project’s configured default model as a pin that beats global sticky state and the model carried from the thread you were viewing.
useHandleNewThread resolves modelSelectionOverride as project?.defaultModelSelection ?? carryModelSelection and applies it (with replaceOptions: true) on every path that starts a new thread: minting a fresh draft after sticky state, resurrecting an empty stored draft, and reusing the currently viewed empty draft in the same project. Projects without a pin keep the previous sticky + carry behavior.
Reviewed by Cursor Bugbot for commit 119ffac. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix new threads to use the project's default model selection
In useHandleNewThread.ts, the useNewThreadHandler hook now prefers project.defaultModelSelection over the carried model selection when initializing a new thread. When reusing the currently viewed draft as the thread destination, the model selection is also reset using this override with replaceOptions: true. Behavioral Change: new threads in projects with a pinned default model will no longer inherit the previous thread's model selection.
Macroscope summarized 119ffac.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Important
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f5243d29-f06e-4ad2-a996-f01f3193230f
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
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.
❤️ Share
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin skipped on open empty draft
Medium Severity
The project pin is written only inside the workspaceContext branch, so a New Thread click while the mapped empty draft is already open never applies modelSelectionOverride. That draft keeps its sticky or carried selection, so a pin meant to bind the project to a provider instance does not take effect on the common reuse path, including drafts that this change is supposed to heal.
Reviewed by Cursor Bugbot for commit 119ffac. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Not approved
Macroscope's review found this PR not approvable — This PR changes runtime behavior for model selection when creating new threads. An unresolved review comment from Cursor Bugbot identifies a potential gap where the project pin doesn't apply when reusing an already-open empty draft, suggesting the fix may be incomplete.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
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.
|