@@ -542,8 +542,10 @@ export function buildModelsRequest(prov: OcxProviderConfig, apiKey: string | und
542542 * the primary source; this keeps the static fallback (and models-not-in-/models) current.
543543 *
544544 * Only touches providers that are registry-managed AND still `authMode: "oauth"`. Preset fields
545- * are refreshed, while the registry's `liveModels` default is filled only when the user has no
546- * explicit toggle. Persists + returns true when anything changed.
545+ * are refreshed, while the registry's `liveModels` default is normally filled only when no value
546+ * is stored. Antigravity has one versioned exception below because its old GUI-generated `true`
547+ * cannot be distinguished from a hand-written pre-migration `true`. Persists + returns true when
548+ * anything changed.
547549 */
548550function cloneProviderField ( value : unknown ) : unknown {
549551 if ( Array . isArray ( value ) ) return [ ...value ] ;
@@ -580,9 +582,11 @@ export function reconcileOAuthProviders(config: OcxConfig): boolean {
580582 config . googleAntigravityStaticCatalogVersion !== GOOGLE_ANTIGRAVITY_STATIC_CATALOG_VERSION ;
581583 for ( const [ name , prov ] of Object . entries ( config . providers ) ) {
582584 const def = OAUTH_PROVIDERS [ name ] ;
583- // Normalize the canonical row before the OAuth-only reconciliation guard. Legacy GUI
584- // saves can carry an omitted or non-OAuth authMode, and stamping the migration marker
585- // while skipping such a row would make its materialized `true` look user-authored later.
585+ // Normalize the canonical row before the OAuth-only reconciliation guard. The old GUI and a
586+ // manual edit both persist the same bare `true`, with no source metadata, so every ambiguous
587+ // pre-marker value is reset once. A deliberate live-discovery choice can be re-enabled after
588+ // the marker and is then preserved. Do this before the guard so omitted/non-OAuth authMode
589+ // rows do not get stamped without actually receiving the new static default.
586590 if ( name === GOOGLE_ANTIGRAVITY_PROVIDER && migrateAntigravityStaticCatalog && prov . liveModels !== false ) {
587591 prov . liveModels = false ;
588592 changed = true ;
@@ -598,9 +602,9 @@ export function reconcileOAuthProviders(config: OcxConfig): boolean {
598602 }
599603 changed = true ;
600604 }
601- // Before this marker existed, the GUI materialized an omitted `liveModels` as `true`
602- // on any settings save. The pre-guard normalization above resets that legacy state
603- // once; choices made after this migration are preserved by the version boundary .
605+ // Before this marker existed, the GUI materialized an omitted `liveModels` as `true` on any
606+ // settings save. Since persisted values have no provenance, the pre-guard normalization above
607+ // intentionally resets all pre-marker `true` values once. Later choices are version-bounded .
604608 if ( prov . liveModels === undefined && preset . liveModels !== undefined ) {
605609 prov . liveModels = preset . liveModels ;
606610 changed = true ;
@@ -676,9 +680,9 @@ export function upsertOAuthProvider(config: OcxConfig, provider: string): void {
676680 const existing = config . providers [ provider ] ;
677681 const next : OcxProviderConfig = { ...def . providerConfig } ;
678682 // `liveModels` is a user-facing provider toggle. A registry default seeds new rows, but an
679- // explicit post-migration choice must survive re-login and the latest-config upsert. A
680- // pre-marker Antigravity `true` may have been materialized by the old GUI , so it is reset
681- // once instead of being misclassified as user provenance .
683+ // explicit post-migration choice must survive re-login and the latest-config upsert. Old GUI
684+ // saves and manual edits left identical pre-marker `true` values , so that ambiguous state is
685+ // reset once; users who deliberately forced discovery can re-enable it after migration .
682686 const preserveExistingLiveModels = provider !== GOOGLE_ANTIGRAVITY_PROVIDER
683687 || config . googleAntigravityStaticCatalogVersion === GOOGLE_ANTIGRAVITY_STATIC_CATALOG_VERSION ;
684688 if ( preserveExistingLiveModels && typeof existing ?. liveModels === "boolean" ) {
0 commit comments