fix(catalog): preserve captured discovery authority with agy aliases (carry of #3531) - #3601
Conversation
Carries #3531 by benedictusrey. Co-authored-by: benedictusrey <192305729+benedictusrey888@users.noreply.github.com>
applyProviderConfigHints re-derived the provider alias via effectiveProviderAliasDecision -> PROVIDER_REGISTRY.find whenever no decision was threaded in. On the cached/configured paths that call runs after the flight has already been admitted, so a gather that outlives a registry override reads the live registry instead of its captured authority. With the registry made unavailable post-admission the lookup threw and the whole provider row was dropped: tests/codex-integration/codex-gather-authority.test.ts:158 expected ["custom-only"] and received []. The alias is already resolved once at admission in captureProviderGather and threaded through every internal call site as effectiveAlias, so the fallback only ever fired for callers outside a flight. Carry the row's existing providerAlias there instead of consulting the registry again. Co-authored-by: benedictusrey <192305729+benedictusrey888@users.noreply.github.com>
The doc-comment still claimed "All other providers keep the raw slug exactly as before" after a second provider-specific rule was added. Records where the agy prefix comes from (the row's providerAlias, decided once per gather flight), what null means, and that the #2960 effective-alias path keeps the canonical provider name. Co-authored-by: benedictusrey <192305729+benedictusrey888@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughChangesThe change adds registry and configured provider aliases, resolves alias ownership and collisions, propagates decisions through live and cached catalog models, and relabels Google Antigravity display names without changing routing slugs. Provider alias resolution
Catalog propagation
Display routing
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Config
participant CatalogGather
participant AliasResolver
participant CatalogModel
participant CatalogSync
Config->>CatalogGather: provide provider configuration
CatalogGather->>AliasResolver: resolve effective alias
AliasResolver-->>CatalogGather: return alias decision
CatalogGather->>CatalogModel: apply providerAlias
CatalogModel->>CatalogSync: provide model and routing slug
CatalogSync-->>CatalogModel: render aliased display name
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 646d7207cc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const claimedByOther = Object.entries(config.providers).some(([name, p]) => | ||
| name !== providerName && typeof p.alias === "string" && p.alias.trim().toLowerCase() === lower | ||
| ); |
There was a problem hiding this comment.
Suppress aliases claimed by canonical provider names
When a valid custom provider is named agy alongside an unaliased google-antigravity provider, this check ignores that provider key and still labels Google's catalog rows as agy/<model>. In src/router.ts, the exact hasOwnProvider(config.providers, requestedProvider) lookup runs before alias resolution, so selecting that advertised row silently routes the Google model ID through the custom agy provider. Treat other configured provider names as alias claims here, not only their alias fields.
Useful? React with 👍 / 👎.
| baseUrl: entry.baseUrl, | ||
| ...(entry.apiKeyTransport !== undefined ? { apiKeyTransport: entry.apiKeyTransport } : {}), | ||
| ...(entry.responsesPath ? { responsesPath: entry.responsesPath } : {}), | ||
| ...(entry.alias ? { alias: entry.alias } : {}), |
There was a problem hiding this comment.
Keep the registry fallback distinct from configured aliases
For the normal Google Antigravity OAuth flow, upsertOAuthProvider clones the result of providerConfigSeed, so this stores agy in provider.alias as though the operator explicitly configured it. If another provider already explicitly owns agy before Antigravity is added, the intended registry-fallback suppression is bypassed: both the router and catalog see two configured aliases, yielding an ambiguous/unusable advertised namespace rather than keeping the Google row canonical. The new tests construct the Google provider without this real seed path, so they miss the regression.
Useful? React with 👍 / 👎.
|
✅ Deterministic PR hygiene checks passed. |
Summary
Carries #3531 onto dev and fixes its current Linux-shard regression. The agy alias remains available for Google Antigravity, but applyProviderConfigHints no longer re-reads the live registry after discovery admission: when no captured alias is supplied, it retains the catalog row's providerAlias.
The author's head 5676a80 deterministically returned an empty model list instead of custom-only when the registry became unavailable after admission. The correction preserves the existing #2960 display-name behavior.
Verification
Checklist
Co-authored-by: benedictusrey 192305729+benedictusrey888@users.noreply.github.com
Summary by CodeRabbit
New Features
agyalias for Google Antigravity.Bug Fixes
agy/model.