Skip to content

fix(dashboard): show API-Key-compatible providers in Antigravity CLI Tools model picker - #4503

Merged
diegosouzapw merged 1 commit into
release/v3.8.33from
fix/port-pr-241-antigravity-apikey-providers
Jun 21, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.33from
fix/port-pr-241-antigravity-apikey-providers

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Summary

The API-Key-compatible / passthrough provider groups in ModelSelectModal are derived from the user's modelAliases map (fetched from /api/models/alias). AntigravityToolCard was the only CLI tool card that didn't fetch them or forward the modelAliases prop, so a custom OpenAI-compatible provider added in OmniRoute never surfaced in the Antigravity tool's model picker — routing a custom model to Antigravity from there was impossible.

The card now mirrors the pattern already used by every sibling tool card (Codex, Claude, Cline, Kilo, Droid, OpenClaw, HermesAgent).

Changes

  • AntigravityToolCard.tsx: add modelAliases state, fetchModelAliases() call on expand, and forward the prop to <ModelSelectModal> (+16 / -0).
  • tests/unit/ui/AntigravityToolCard-model-aliases.test.tsx: source-level parity test guarding the wiring (3 assertions: state, fetch call, prop on the modal). RED before fix, GREEN after.
  • CHANGELOG.md: entry under [3.8.32] → 🐛 Fixed.

Test plan

  • npx vitest run tests/unit/ui/AntigravityToolCard-model-aliases.test.tsx — 3/3 pass
  • TDD RED verified: same tests fail (3/3) against the pre-fix file
  • npm run typecheck:core — clean (exit 0)
  • eslint AntigravityToolCard.tsx — 0 errors, 1 warning (pre-existing react-hooks/exhaustive-deps on the same useEffect; unrelated to this change)
  • node scripts/check/check-docs-sync.mjs — PASS (41 locales validated)
  • Manual smoke: open dashboard → CLI Tools → Antigravity → expand → verify custom OpenAI-compatible providers (e.g. user-added API key) now appear in the model picker

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request integrates model aliases into the AntigravityToolCard component, allowing custom OpenAI- and Anthropic-compatible providers to appear in the model selection modal. It also introduces a corresponding unit test file to verify this integration. The review feedback highlights a potential issue in the fetchModelAliases function, where res.json() is called before verifying res.ok, which could lead to unhandled parsing errors if the API returns a non-JSON error response.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +80 to +88
const fetchModelAliases = async () => {
try {
const res = await fetch("/api/models/alias");
const data = await res.json();
if (res.ok) setModelAliases(data.aliases || {});
} catch (error) {
console.log("Error fetching model aliases:", error);
}
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In fetchModelAliases, res.json() is called before verifying if the response is successful (res.ok). If the server returns a non-JSON error response (such as an HTML error page from a gateway or proxy), calling res.json() will throw a parsing error.

To prevent this and maintain consistency with fetchStatus and loadSavedMappings in the same file, check res.ok before attempting to parse the response body.

Suggested change
const fetchModelAliases = async () => {
try {
const res = await fetch("/api/models/alias");
const data = await res.json();
if (res.ok) setModelAliases(data.aliases || {});
} catch (error) {
console.log("Error fetching model aliases:", error);
}
};
const fetchModelAliases = async () => {
try {
const res = await fetch("/api/models/alias");
if (res.ok) {
const data = await res.json();
setModelAliases(data.aliases || {});
}
} catch (error) {
console.log("Error fetching model aliases:", error);
}
};

@diegosouzapw
diegosouzapw force-pushed the fix/port-pr-241-antigravity-apikey-providers branch from cf91b1a to 667e6b3 Compare June 21, 2026 12:58
@diegosouzapw
diegosouzapw changed the base branch from release/v3.8.32 to release/v3.8.33 June 21, 2026 14:02
…Tools model picker

The API-Key-compatible / passthrough provider groups in `ModelSelectModal`
are derived from the user's `modelAliases` map (fetched from
`/api/models/alias`). `AntigravityToolCard` was the only CLI tool card
that didn't fetch them or forward the `modelAliases` prop, so a custom
OpenAI-compatible provider added in OmniRoute never surfaced in the
Antigravity tool's model picker — routing a custom model to Antigravity
from there was impossible.

The card now mirrors the pattern already used by every sibling tool card
(Codex, Claude, Cline, Kilo, Droid, OpenClaw, HermesAgent):

- new `modelAliases` state
- `fetchModelAliases()` called when the card is expanded
- `modelAliases` forwarded to `<ModelSelectModal>`

A source-level parity test guards the wiring so a future refactor can't
silently drop the prop again.

Co-authored-by: maskeen <maskeensingh@protonmail.com>
Inspired-by: decolua/9router#241
@diegosouzapw
diegosouzapw force-pushed the fix/port-pr-241-antigravity-apikey-providers branch from 667e6b3 to e241c60 Compare June 21, 2026 17:14
@diegosouzapw
diegosouzapw merged commit d83e0a4 into release/v3.8.33 Jun 21, 2026
3 checks passed
diegosouzapw added a commit that referenced this pull request Jun 21, 2026
Rebuilt onto release/v3.8.33; reconciled with #4503 (kept fetchModelAliases) — sudo gating now uses server-reported isWin/needsSudoPassword instead of browser UA. Integrated into release/v3.8.33.
@diegosouzapw diegosouzapw mentioned this pull request Jun 22, 2026
@diegosouzapw
diegosouzapw deleted the fix/port-pr-241-antigravity-apikey-providers branch June 22, 2026 02:48
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…Tools model picker (cheaper-inference#4503)

Rebuilt onto release/v3.8.33 (squash-base-stale). Integrated into release/v3.8.33.
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
…per-inference#4514)

Rebuilt onto release/v3.8.33; reconciled with cheaper-inference#4503 (kept fetchModelAliases) — sudo gating now uses server-reported isWin/needsSudoPassword instead of browser UA. Integrated into release/v3.8.33.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant