feat: add Google Vertex AI service account JSON authentication#6287
feat: add Google Vertex AI service account JSON authentication#6287sandys wants to merge 8 commits intoanomalyco:devfrom
Conversation
Add support for authenticating to Google Vertex AI using service account JSON credentials, with proper credential separation from regular Google (Gemini) API keys. Changes: - Add service account JSON auth flow in CLI (`opencode auth login`) - Add TUI dialog for pasting service account JSON with location input - Update provider loaders to use stored credentials with googleAuthOptions - Explicitly set `key: undefined` and `apiKey: null` in Vertex loaders to prevent credential leakage from other providers - Rename "Vertex" to "Google Vertex AI" consistently across UI: - /connect menu - Model selection dialog - Status bar below text entry - Add comprehensive tests verifying credential separation between google, google-vertex, and google-vertex-anthropic providers The three providers (google, google-vertex, google-vertex-anthropic) are now completely independent and can be configured simultaneously without credentials leaking between them.
|
/review |
- Fix textareaRef any type in dialog-provider.tsx - Extract PROVIDER_DISPLAY_NAMES to shared display-names.ts module - Extract createGoogleVertexLoader helper to reduce code duplication - Fix test to clear all Google env vars that could affect provider loading 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # packages/opencode/src/cli/cmd/auth.ts # packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx # packages/opencode/test/provider/provider.test.ts
# Conflicts: # packages/opencode/src/cli/cmd/auth.ts # packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx # packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
# Conflicts: # packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
|
are we going to push this over the hump? it's unblocking a big share of models used via Vertex.AI. They simply are blocked today otherwise. |
# Conflicts: # packages/opencode/src/provider/provider.ts # packages/opencode/test/preload.ts
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
+1 for this! |
|
Strong +1 |
|
Any updates on this? |
|
Im actually a little disappointed at this pr not getting attention from the
opencode team - i have tweeted several times and gemini team have replied
in support.
Would appreciate if the opencode team clarify if their focus is to support
their own paid models and third party models are no longer a focus.
It is a struggle maintaining this pr through tons of opencode
versions...and im not even sure if there is any real strategic interest in
doing so.
…On Mon, 23 Mar, 2026, 20:51 Bert Vanhaeke, ***@***.***> wrote:
*bertPB* left a comment (anomalyco/opencode#6287)
<#6287 (comment)>
Any updates on this?
This is a big blocker to adopt/trial opencode within our org
—
Reply to this email directly, view it on GitHub
<#6287?email_source=notifications&email_token=AAASYU6AW7VRJ4C267KFMI34SFI5ZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJRGE2DKMJUHA2KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4111451484>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASYU2ZYQ4MAMHQ5BNEQ434SFI5ZAVCNFSM6AAAAACQFDWOE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMJRGQ2TCNBYGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Interested in seeing this pushed across the finish line. |
|
Is this going anywhere or has the opencode team decided to ignore this persistent issue? |
|
Idk if it helps anybody, but I've been able to use it by setting the following environment variables not really sure if they are all required but that's the setup I was using for Claude Code and it works just fine in OpenCode too |
Add support for authenticating to Google Vertex AI using service account JSON credentials, with proper credential separation from regular Google (Gemini) API keys.
Google Cloud actively makes it hard to use api keys with Vertex - with a complicated permission grant structure. The preferred mechanism is service accounts with json tokens. Not supporting it is a huge problem.
Changes:
opencode auth login)key: undefinedandapiKey: nullin Vertex loaders to prevent credential leakage from other providersThe three providers (google, google-vertex, google-vertex-anthropic) are now completely independent and can be configured simultaneously without credentials leaking between them.
for issues
#5712
#6280
#5711
#3586
#5097
#4282
#272
#553
#402
#1204