#15205: fix(models): normalize google-antigravity api field from google-gemini-cli
agents
size: L
Cluster:
Tool Schema Fixes and Enhancements
## 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
#3322: fix: merge provider config api into registry model
by nulone · 2026-01-28
82.1%
#22214: fix(tools): sanitize google-antigravity schemas for Gemini-compatib...
by Kansodata · 2026-02-20
80.5%
#13119: fix: add forward-compat for google-antigravity claude-opus-4-6 models
by sdb001 · 2026-02-10
80.5%
#11882: fix: accept openai-codex/gpt-5.3-codex model refs
by jackberger03 · 2026-02-08
79.8%
#13361: fix(google-antigravity): add Opus 4.6 support and fix thinking.sign...
by SovranAMR · 2026-02-10
79.8%
#2353: fix: ensure api field is set for inline provider models
by sbknana · 2026-01-26
79.1%
#21835: fix: apply schema cleaning for google-antigravity in normalizeToolP...
by ephraimm · 2026-02-20
79.0%
#23424: feat: add Gemini 3.1 Pro Preview support (google-gemini-cli)
by hongchanroh · 2026-02-22
78.5%
#14508: fix(models): allow forward-compat models in allowlist check
by jonisjongithub · 2026-02-12
78.5%
#22899: fix(models): synthesize antigravity Gemini 3.1 pro high/low models
by Phineas1500 · 2026-02-21
78.4%