Repository navigation
fix(shared): new chats use the global default when the project default model is hidden #23615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5d21cd4
70805ba
5cf5e83
3e7310f
3ed86b5
85e80d4
aee1ad2
03ddc7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ import { | |
| type ThreadEnvMode, | ||
| type WorktreeCleanupRules, | ||
| } from "@t3tools/contracts"; | ||
| import { readCustomModelEntries } from "./model.ts"; | ||
| import { normalizeProjectPathForComparison } from "./path.ts"; | ||
| import { fallbackTextGenerationModelSelection } from "./serverSettings.ts"; | ||
|
|
||
|
|
@@ -148,6 +149,21 @@ function resolveProjectOverrides( | |
| ) { | ||
| continue; | ||
| } | ||
| // Clients resolve a hidden model to the catalog's first visible one, so a | ||
| // hidden project default would silently pick a model nobody chose. | ||
| // Custom models stay visible even when listed as hidden, as in the clients. | ||
| if (key === "defaultModelSelection" && value !== null) { | ||
| const { instanceId, model } = value as ModelSelection; | ||
| const config = settings.providerInstances[instanceId]?.config as | ||
| | { customModels?: unknown } | ||
| | undefined; | ||
| if ( | ||
| settings.providerModelPreferences?.[instanceId]?.hiddenModels.includes(model) && | ||
| !readCustomModelEntries(config?.customModels).some((entry) => entry.slug === model) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not treat every configured custom slug as visible. If
|
||
| ) { | ||
| continue; | ||
| } | ||
| } | ||
| effective[key] = value; | ||
| sources[key] = "project"; | ||
| } | ||
|
|
||
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.
Script executed:
Repository: pingdotgg/t3code
Length of output: 34761
Script executed:
Repository: pingdotgg/t3code
Length of output: 37082
Script executed:
Repository: pingdotgg/t3code
Length of output: 42433
Script executed:
Repository: pingdotgg/t3code
Length of output: 20698
Script executed:
Repository: pingdotgg/t3code
Length of output: 3535
Script executed:
Repository: pingdotgg/t3code
Length of output: 7096
Script executed:
Repository: pingdotgg/t3code
Length of output: 9670
Use legacy preferences when resolving new-draft defaults.
If server preferences are null, a draft created before migration completes can retain the hidden project default and select a catalog fallback instead of the environment default. Resolve the project default with the merged preferences before seeding the draft, while keeping server preferences authoritative.