vendor: adopt upstream PR #7515 (new threads honor the project default model) - #6
Closed
Jardo-51 wants to merge 1 commit into
Closed
vendor: adopt upstream PR #7515 (new threads honor the project default model)#6Jardo-51 wants to merge 1 commit into
Jardo-51 wants to merge 1 commit into
Conversation
(cherry picked from commit 119ffac)
Owner
Author
|
Closing in favor of pingdotgg#6011 which was already merged to upstream. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adopts unmerged upstream PR pingdotgg#7515 ("fix(web): new threads honor the project default model", fixes upstream issue 5796).
What it changes
useNewThreadHandlernow resolvesproject.defaultModelSelection ?? carryModelSelectionand applies that override on all three draft seed paths (empty stored draft, reuse of the viewed empty draft, mint-fresh). A project's configured default model beats both the globally sticky last-used pick and the selection carried from the viewed thread; projects without a pin keep the current sticky + carry behavior, and explicit composer picks still win.One file,
apps/web/src/hooks/useHandleNewThread.ts, +31/-15.Review flags
Nothing security-relevant: no network calls, telemetry, or credential handling; no process spawning or permission/sandbox/auth logic; no new dependencies, postinstall scripts, or CI changes; no version fields touched.
Worth knowing behaviorally: the pin includes the provider instance, so this changes which subscription a new thread starts on when a project has a default model configured. That is the point of the fix, but it is a user-visible change in where work gets billed.
Verification
vp test run apps/web/src/composerDraftStore.test.ts apps/web/src/threadRoutes.test.ts— 90 passedvp lint apps/web/src/hooks/useHandleNewThread.ts— cleanvp run --filter @t3tools/web typecheck— cleandefaultModelSelectionappears exactly once inuseHandleNewThread.ts; no second resolution path was introduced alongside an existing one.currentRouteTarget.kind === "draft",carryModelSelectionresolves to that draft's own composer selection, so the unpinned write is genuinely a no-op.mainandcustom/main, so the patch applied in the same context it was written against.Not verified: no integrated pass in a real client (no browser run). The upstream author reports testing new threads across two Claude instances with opposite project pins in both directions.
No fork-specific fixup commits were needed — the cherry-pick is patch-identical to upstream's commit.
Adoption note
This is adopted third-party code, unreviewed upstream and permanent by default in this fork: do not revert it to make a future sync easier. When upstream lands its own version, resolve the conflict toward upstream's version wholesale and re-apply any local adaptations as a separate commit.