fix(settings): match text generation models by provider identity - #253
fix(settings): match text generation models by provider identity#253leoisadev1 wants to merge 1 commit into
Conversation
Copying a title-generation model by instance id can land on a disabled or different provider on another environment. Map the selection onto a target by enabled driver identity instead, and keep the target's working model when nothing matches. Upstream: pingdotgg#10526 Grok 4.6 High in Grok Build via Orca.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis change adds cross-environment mapping for text-generation model selections, changes repository identity remote preference to favor One merge-blocking issue remains: environments using enabled legacy provider configuration cannot receive a valid text-generation selection. T-Rex validation blockedRepository remote-preference behavior could not be exercised because the validation runtime lacked the required Confidence Score: 4/5Not safe to merge until legacy provider targets preserve valid text-generation selections. Runtime validation reproduced one functional failure: an enabled legacy provider target loses its selected text-generation model during environment mapping. Files Needing Attention: packages/shared/src/serverSettings.ts
What T-Rex did
|
| const sameId = targetSettings.providerInstances[selection.instanceId]; | ||
| if ( | ||
| sameId !== undefined && | ||
| sameId.driver === sourceDriver && | ||
| resolveProviderInstanceEnabled(sameId) | ||
| ) { | ||
| return createModelSelection(selection.instanceId, selection.model, selection.options); | ||
| } | ||
|
|
||
| const matched = Object.entries(targetSettings.providerInstances).find( | ||
| ([, instance]) => instance.driver === sourceDriver && resolveProviderInstanceEnabled(instance), | ||
| ); | ||
| if (matched === undefined) return undefined; |
There was a problem hiding this comment.
When a connected environment still uses an enabled legacy provider entry such as providers.claudeAgent, this helper only searches providerInstances and returns undefined. The selected text-generation model is therefore not transferred even though the target has that provider enabled, leaving generated text without the intended model selection. This must be fixed before merging.
Artifacts
- Authored and executed validation script exercising same-ID, renamed, disabled, different-driver, missing, legacy, model, and option mapping behavior; it exposes the enabled legacy target failure.
- Executed the authored Node validation script in `/home/user/repo`; the first five requested instance-map cases pass and the enabled legacy provider assertion fails, confirming the defect.
Problem
Thread titles could use a different model than the one shown in General when the selection is copied across environments by instance id. A disabled or differently-drivered instance on the target would still receive the source id.
Fix
Add textGenerationSelectionForTarget, which maps a title-generation model onto another environment by enabled provider identity (driver). Same-id copies only proceed when that instance exists, is enabled, and has the same driver. Otherwise it uses another enabled instance of that driver, or leaves the target alone.
dontAsk for Claude metadata generation already shipped in #247. Akeru does not have T3 Code's apply-to-all shared-settings client; this helper is the identity-matching contract that client should use when a selection is applied to another environment.
This is an Akeru adaptation of upstream T3 Code work.
Upstream
Verification
vp test run packages/shared/src/serverSettings.test.ts— 28 passedGeneral settings copy now says titles use this model on connected environments that have the provider enabled.
Model
Grok 4.6 High in Grok Build via Orca.