Skip to content

fix(catalog): preserve captured discovery authority with agy aliases (carry of #3531) - #3601

Merged
lidge-jun merged 4 commits into
devfrom
codex/260905-antigravity-agy-alias
Sep 5, 2026
Merged

fix(catalog): preserve captured discovery authority with agy aliases (carry of #3531)#3601
lidge-jun merged 4 commits into
devfrom
codex/260905-antigravity-agy-alias

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

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

  • Worker evidence: codex-gather-authority RED 5 pass / 1 fail, GREEN 6 pass / 0 fail.
  • Worker evidence: typecheck exit 0; catalog/alias/layout named files 311 pass; four adjacent contract files 115 pass.
  • No local suite is being run. Final dev Linux shards are the batch acceptance gate as requested.
  • Stack: independent E4 layer targeting dev.

Checklist

  • Focused carry plus verified Linux-shard fix.
  • Contract documentation corrected.
  • No authentication or secret-handling changes.

Co-authored-by: benedictusrey 192305729+benedictusrey888@users.noreply.github.com

Summary by CodeRabbit

  • New Features

    • Added support for provider aliases, including the built-in agy alias for Google Antigravity.
    • Provider aliases now appear consistently in catalog entries, picker display names, cached models, and discovered models.
    • Explicitly configured aliases take precedence over built-in aliases.
  • Bug Fixes

    • Improved provider/model routing to resolve aliases consistently and case-insensitively.
    • Ambiguous provider aliases now produce descriptive errors instead of selecting an arbitrary match.
    • Preserved routing slugs while allowing compact display names such as agy/model.

benedictusrey888 and others added 4 commits September 5, 2026 11:04
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>
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 03:35
@lidge-jun lidge-jun added the bug Something isn't working label Sep 5, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T03:39:06.055625Z 646d720 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun
lidge-jun merged commit 4504562 into dev Sep 5, 2026
4 of 7 checks passed
@lidge-jun
lidge-jun deleted the codex/260905-antigravity-agy-alias branch September 5, 2026 03:35
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 0760ba89-b084-4f73-b0d9-4545861ca19b

📥 Commits

Reviewing files that changed from the base of the PR and between 3191fe1 and 646d720.

📒 Files selected for processing (9)
  • src/codex/catalog/parsing.ts
  • src/codex/catalog/provider-fetch.ts
  • src/codex/catalog/sync.ts
  • src/providers/default-aliases.ts
  • src/providers/derive.ts
  • src/providers/registry.ts
  • src/router.ts
  • tests/codex-integration/codex-catalog.test.ts
  • tests/providers/provider-model-aliases.test.ts

📝 Walkthrough

Walkthrough

Changes

The 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

Layer / File(s) Summary
Alias resolution and routing
src/providers/registry.ts, src/providers/default-aliases.ts, src/providers/derive.ts, src/router.ts, tests/providers/provider-model-aliases.test.ts
Registry aliases and configured aliases now support precedence, collision suppression, ambiguity errors, and canonical provider-name routing.

Catalog propagation

Layer / File(s) Summary
Catalog alias propagation
src/codex/catalog/parsing.ts, src/codex/catalog/provider-fetch.ts, tests/providers/provider-model-aliases.test.ts
Catalog gathering captures the effective alias once and applies it to configured, live, and cached models. Cache-boundary tests cover alias ownership changes.

Display routing

Layer / File(s) Summary
Routed display names
src/codex/catalog/sync.ts, tests/codex-integration/codex-catalog.test.ts
Google Antigravity models use agy/ or an explicit alias in display names while retaining google-antigravity/<id> routing slugs.

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
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/260905-antigravity-agy-alias

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +17 to +19
const claimedByOther = Object.entries(config.providers).some(([name, p]) =>
name !== providerName && typeof p.alias === "string" && p.alias.trim().toLowerCase() === lower
);

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 Badge 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 👍 / 👎.

Comment thread src/providers/derive.ts
baseUrl: entry.baseUrl,
...(entry.apiKeyTransport !== undefined ? { apiKeyTransport: entry.apiKeyTransport } : {}),
...(entry.responsesPath ? { responsesPath: entry.responsesPath } : {}),
...(entry.alias ? { alias: entry.alias } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants