Skip to content

fix(settings): match text generation models by provider identity - #253

Open
leoisadev1 wants to merge 1 commit into
mainfrom
fix/text-generation-model-identity
Open

fix(settings): match text generation models by provider identity#253
leoisadev1 wants to merge 1 commit into
mainfrom
fix/text-generation-model-identity

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

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 passed
  • Targeted lint — no new issues

General 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.

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.
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
akeru-bot-landing Building Building Preview Sep 10, 2026 6:37pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 10, 2026
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

This change adds cross-environment mapping for text-generation model selections, changes repository identity remote preference to favor origin, updates related tests, and clarifies the settings description.

One merge-blocking issue remains: environments using enabled legacy provider configuration cannot receive a valid text-generation selection.

T-Rex validation blocked

Repository remote-preference behavior could not be exercised because the validation runtime lacked the required ChildProcessSpawner service.

Confidence Score: 4/5

Not 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

T-Rex T-Rex Logs

What T-Rex did

  • Generated a proof for a posted P1 finding and attached the corresponding TypeScript artifact and review log.
  • Authored real Git fixtures for origin and upstream preferences, fetch-versus-push URLs, malformed remotes, and alphabetical fallback, and ran the fixture suite; execution halted because the resolver runtime was missing the ChildProcessSpawner service.
  • Produced an additional P1 finding proof for a posted review comment.
  • Validated a runtime discrepancy where textGenerationSelectionForTarget returned undefined for a legacy claudeAgent target, despite the provider being enabled; runtime output captures actual versus expected values.
  • Ran the authored runner again; it captured the command, working directory, exit code, and stack trace, revealing the missing RepositoryIdentityResolver.layer service as the blocking cause.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 Enabled legacy provider targets cannot receive text-generation selections

    • Bug
      • textGenerationSelectionForTarget returns undefined when both source and target use the legacy providers.claudeAgent configuration without a providerInstances entry, despite the target legacy provider being enabled. This drops a valid text-generation selection during target settings mapping.
    • Cause
      • At packages/shared/src/serverSettings.ts:71-83, target resolution only checks targetSettings.providerInstances; unlike source driver resolution, it does not fall back to the enabled legacy provider configuration.
    • Fix
      • When no matching enabled target provider instance exists, allow the canonical legacy instance ID for sourceDriver when targetSettings.providers[sourceDriver].enabled === true, preserving the selection's model and options.

    T-Rex Ran code and verified through T-Rex

Fix all with Greploop Fix All in Claude Code

Reviews (1): Last reviewed commit: "fix(settings): match text generation mod..." | Re-trigger Greptile

Comment on lines +71 to +83
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Legacy selections are dropped

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

Evidence from the check

  • 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.

Command output from the check

  • 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.

View artifacts

T-Rex Ran code and verified through T-Rex

Fix in Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant