fix(google): allow opting out of the direct Gemini -tiered wire rename - #1771
fix(google): allow opting out of the direct Gemini -tiered wire rename#1771chilung-cgu wants to merge 2 commits into
Conversation
Keep the existing -tiered mapping by default while allowing AI Studio providers that still serve bare Gemini Flash ids to opt out. Cover both Flash generations and document the provider setting.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
Summary
Google's Generative Language API renamed current Gemini Flash generations on the wire with a
-tieredsuffix (gemini-3.7-flash->gemini-3.7-flash-tiered,gemini-3.6-flash->gemini-3.6-flash-tiered), and opencodex applies that rename by default in the AI Studio (direct) path. Some AI Studio deployments/keys still serve the bare ids and return404 NOT_FOUND(models/gemini-3.7-flash-tiered is not found for API version v1beta) for every renamed request.This PR adds a per-provider opt-out:
directGeminiWireRenames: falsekeeps the picker-visible id stable while sending the bare id on the wire. Default behavior (rename applied) is unchanged; Vertex requests are unaffected.Verification
bun run typecheckpasses.bun test tests/google-adapter.test.ts tests/config.test.tspasses (159 tests, including new coverage for the opt-out round-trip and the Vertex exclusion).generativelanguage.googleapis.com/v1beta/modelsconfirmed the affected account serves bare ids only; with the opt-out set, the request reachesmodels/gemini-3.7-flash:generateContentand succeeds.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.