Correct Gemini CLI LLM gateway config to proxy mode#5142
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Gemini CLI integration so thv llm setup writes a valid ~/.gemini/settings.json for LLM gateway usage by switching from the previously attempted (invalid) direct-mode keys to Gemini CLI’s proxy-mode configuration.
Changes:
- Switch Gemini CLI LLM gateway integration from
directtoproxymode. - Replace invalid Gemini CLI settings keys (
/auth/tokenCommand,/baseUrl) with proxy-mode keys under/security/authand/env. - Update the real-config integration test expectations for Gemini CLI settings content.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/client/config.go | Updates Gemini CLI’s LLM gateway mode and JSON pointers/values written into ~/.gemini/settings.json. |
| pkg/client/llm_gateway_test.go | Updates the “real production configs” test assertions to reflect the new Gemini CLI proxy-mode keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5142 +/- ##
==========================================
- Coverage 67.37% 67.37% -0.01%
==========================================
Files 599 600 +1
Lines 60610 60632 +22
==========================================
+ Hits 40839 40853 +14
- Misses 16677 16685 +8
Partials 3094 3094 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
68aeda9 to
9cebd22
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9cebd22 to
e2db88b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e2db88b to
b883273
Compare
b883273 to
2a7cd70
Compare
2a7cd70 to
c2e2d2a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c2e2d2a to
bae9163
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bae9163 to
d0c8864
Compare
Gemini CLI has no dynamic token-command equivalent (no apiKeyHelper analogue), so it must use proxy mode like Cursor rather than direct mode. The previous config used two invalid settings.json keys: - /auth/tokenCommand — not a recognised Gemini CLI field - /baseUrl — silently ignored as a top-level key Replace with the correct proxy-mode keys: - /security/auth/selectedType = "gemini-api-key" (required so that GOOGLE_GEMINI_BASE_URL is honoured; OAuth auth ignores the override, fixed in gemini-cli v0.40.0 PR #25357) - /env/GEMINI_API_KEY = placeholder key (proxy does not validate it) - /env/GOOGLE_GEMINI_BASE_URL = local proxy address Fixes #5141
d0c8864 to
ffef687
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Gemini CLI has no dynamic token-command equivalent (no apiKeyHelper analogue), so it must use proxy mode like Cursor rather than direct mode.
The previous config used two invalid settings.json keys:
Replace with the correct proxy-mode keys:
Fixes #5141
Type of change
Test plan
task test)task test-e2e)task lint-fix)API Compatibility
v1beta1API, OR theapi-break-allowedlabel is applied and the migration guidance is described above.Changes
Does this introduce a user-facing change?
Implementation plan
Approved implementation plan
Special notes for reviewers