← Back to PRs

#15205: fix(models): normalize google-antigravity api field from google-gemini-cli

by wboudy open 2026-02-13 05:03 View on GitHub →
agents size: L
## Summary Normalizes the `api` field for google-antigravity models which are incorrectly assigned `api: "google-gemini-cli"` by the pi-ai library. ## Problem The pi-ai library assigns `api: "google-gemini-cli"` to google-antigravity models, which causes misrouting and incorrect API behavior. The correct value should be `api: "google-antigravity"`. ## Solution - Add `normalizeProviderApi()` function to correct api field based on provider identity - Apply normalization during provider config processing in `normalizeProviders()` - Fix forward-compat model resolution for Opus 4.6 to use correct api value ## Files Changed - `src/agents/models-config.providers.ts` - Add api field normalization logic - `src/agents/pi-embedded-runner/model.ts` - Fix api override in forward-compat resolution - `src/agents/models-config.normalizes-antigravity-api.test.ts` - 9 unit tests - `src/agents/pi-embedded-runner/model.test.ts` - Updated test ## Testing - `pnpm build` → exit 0 - `pnpm check` → exit 0 - `pnpm test src/agents/models-config.normalizes-antigravity-api.test.ts src/agents/pi-embedded-runner/model.test.ts` → 21 tests pass ## AI-assisted disclosure Developed with AI assistance (Claude Opus 4.5) per CONTRIBUTING.md. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds normalization to correct the `api` field for the `google-antigravity` provider when upstream config incorrectly tags it as `google-gemini-cli`, and updates the embedded runner’s forward-compat model resolution so Opus 4.6 antigravity fallbacks use the corrected api value. It also adds unit tests covering provider api normalization and the forward-compat resolution behavior. One issue to address before merge: provider *keys* are still written back under their original (potentially untrimmed) key in `normalizeProviders()`, which means merge-mode `models.json` entries with whitespace keys won’t actually be normalized and can cause later provider config lookups to miss. <h3>Confidence Score: 4/5</h3> - Mostly safe to merge once provider-key normalization is fixed. - Changes are targeted and covered by focused tests, but `normalizeProviders()` currently doesn’t actually normalize provider map keys (only values), which can leave merge-mode `models.json` in a broken state when keys contain whitespace. - src/agents/models-config.providers.ts <sub>Last reviewed commit: 1fa6ac7</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs