You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(gemini): honor provider routing on native generation - #9066
Apply the Antigravity provider’s proxy and noProxy settings when native Gemini generation sends a request. Resolve the route for the final URL on every send, including the retry after OAuth refresh. The default transport inherits the process settings when the provider has no override. Token exchange and refresh themselves retain the process-wide route.
Verification
At e436084a2 with dev3ec89d266 merged, Windows x64 and Bun 1.4.4 passed all six selected routing cases in tests/server/gemini-native.test.ts (34 assertions). They cover process NO_PROXY conflicts before dispatch, opaque executors, and four routes across OAuth refresh. Typecheck passed for 2,701 files. structure:check, privacy:scan, and git diff --check passed. The local run focused on the changed route while other Windows validations shared the test host. Broader coverage is left to PR CI.
Earlier validation at 2deaa9369
Windows, Bun 1.4.4. The six focused test files passed all 101 tests. The new cases use a mocked transport for inherited, explicit proxy, direct, and host-specific routes across a refresh. A separate case checks that an incompatible custom transport receives no request.
bun check --no-script --noEmit passed for 2,691 files. The structure and privacy checks passed. The docs build produced 820 pages and the internal link check passed.
Independently reviewed the dispatch, redirect, cancellation, retry, and request-slot handling. Local validation focused on the changed transport and its adjacent contracts. The full local suite and live Google account traffic were outside this run.
Checklist
Scope is limited to the native Gemini generation transport and its regression coverage.
Updated the native data-plane contract and operator reference.
Reviewed route inheritance, OAuth retry boundaries, and client-facing errors. Maintainer review is requested.
Summary by CodeRabbit
New Features
Native Gemini requests now honor the Antigravity provider’s configured outbound proxy and noProxy settings, including retries after credential refresh.
Bug Fixes
Conflicting proxy settings or invalid egress configuration now return a 503 response with configuration guidance before a generation request is sent.
Documentation
Clarified that native generation uses the provider’s outbound proxy settings, while OAuth token exchange and refresh use the process-wide route.
No actionable comments were generated in the recent review.
Walkthrough
Native Gemini generation now uses the Antigravity provider’s proxy settings for outbound sends. The handler selects an outbound executor, applies proxy and noProxy policy, and returns a 503 error for invalid egress configuration. Tests cover initial sends and retries after credential refresh.
Changes: Native Gemini proxy routing
Layer / File(s)
Summary
Configure and validate native Gemini egress src/server/gemini-native.ts, structure/data-planes/gemini-native.md, tests/server/gemini-native.test.ts, docs-site/src/content/docs/reference/proxy-formats.md
The handler applies provider proxy settings and noProxy policy to each physical send through the selected outbound executor. Invalid egress configuration returns a 503 error before dispatch. Tests cover inherited, explicit, direct, and provider-noProxy routing on initial sends and retries. The documentation distinguishes native-generation routing from OAuth token exchange and refresh routing.
lidge-jun/opencodex#9112: Defines the explicit-proxy and process NO_PROXY conflict checked by this change.
Suggested reviewers:liang-psych
Merge Risk: Minimal · up to e4360
Native Gemini generation now follows the Antigravity provider's proxy and noProxy settings, and invalid egress configuration returns a clear 503 before any request is sent. No merge-blocking risk was identified. The change is easy to revert.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(gemini): honor provider routing on native generation" matches the main change. The PR applies the Antigravity provider's proxy and noProxy settings to native Gemini generation, includin…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "fix(gemini): honor provider routing on native generation" matches the main change. The PR applies the Antigravity provider's proxy and noProxy settings to native Gemini generation, including the retry after OAuth refresh. The title names the core behavior. It does not mention the 503 guard for conflicting proxy and NO_PROXY settings, which is a secondary part of the change. The title is specific and concise.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between 2deaa93 and e436084.
Files selected for processing: 3
src/server/gemini-native.ts
structure/data-planes/gemini-native.md
tests/server/gemini-native.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apply the Antigravity provider’s
proxyandnoProxysettings when native Gemini generation sends a request. Resolve the route for the final URL on every send, including the retry after OAuth refresh. The default transport inherits the process settings when the provider has no override. Token exchange and refresh themselves retain the process-wide route.Verification
e436084a2withdev3ec89d266merged, Windows x64 and Bun 1.4.4 passed all six selected routing cases intests/server/gemini-native.test.ts(34 assertions). They cover processNO_PROXYconflicts before dispatch, opaque executors, and four routes across OAuth refresh. Typecheck passed for 2,701 files.structure:check,privacy:scan, andgit diff --checkpassed. The local run focused on the changed route while other Windows validations shared the test host. Broader coverage is left to PR CI.Earlier validation at
2deaa9369bun check --no-script --noEmitpassed for 2,691 files. The structure and privacy checks passed. The docs build produced 820 pages and the internal link check passed.Checklist
Summary by CodeRabbit
noProxysettings, including retries after credential refresh.