Skip to content

fix(core): honor GOOGLE_GEMINI_BASE_URL and GOOGLE_VERTEX_BASE_URL#25356

Closed
chrisjcthomas wants to merge 2 commits intogoogle-gemini:mainfrom
chrisjcthomas:codex/honor-gemini-vertex-base-urls
Closed

fix(core): honor GOOGLE_GEMINI_BASE_URL and GOOGLE_VERTEX_BASE_URL#25356
chrisjcthomas wants to merge 2 commits intogoogle-gemini:mainfrom
chrisjcthomas:codex/honor-gemini-vertex-base-urls

Conversation

@chrisjcthomas
Copy link
Copy Markdown
Contributor

Fixes #15430

Summary

This change wires custom base URL overrides through the core content generator so they are passed to @google/genai via httpOptions.baseUrl.

What Changed

  • Added baseUrl to ContentGeneratorConfig
  • Resolved GOOGLE_GEMINI_BASE_URL for AuthType.USE_GEMINI
  • Resolved GOOGLE_VERTEX_BASE_URL for AuthType.USE_VERTEX_AI
  • Passed baseUrl into GoogleGenAI through httpOptions
  • Added validation so custom base URLs must be HTTPS unless they point to localhost
  • Added unit tests covering Gemini and Vertex overrides, localhost HTTP overrides, invalid URLs, and insecure non-local HTTP URLs

Why

The Gemini CLI uses @google/genai, which supports a custom base URL via httpOptions.baseUrl. Before this change, the CLI propagated the environment variables but did not apply them when instantiating the SDK client.

Validation

  • npm test -- src/core/contentGenerator.test.ts
  • npm run typecheck

Notes

  • I attempted the repo pre-commit hook as part of commit flow, but it currently fails due to an existing ESLint/plugin crash in import/no-internal-modules rather than this patch.
  • The patch keeps localhost HTTP support for local proxies while requiring HTTPS for remote overrides.

Your Name and others added 2 commits February 17, 2026 01:42
- Document vi mode keyboard shortcuts in keyboard-shortcuts.md
  including navigation, editing, and mode switching commands
- Add note that custom sandbox Dockerfile builds are only supported
  when running from source code (not via npm install)

Closes google-gemini#17381, google-gemini#15141
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 14, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@chrisjcthomas
Copy link
Copy Markdown
Contributor Author

Recreated on #25357 using a neutral branch name.

@chrisjcthomas chrisjcthomas deleted the codex/honor-gemini-vertex-base-urls branch April 14, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI ignores GOOGLE_GEMINI_BASE_URL and forces Cloud Auth/Endpoints

1 participant