Repository navigation
Add Vertex AI providers (google-vertex, google-vertex-anthropic) + optionsRequired - #23
Merged
Merged
Conversation
Capture an OpenSpec change adding google-vertex (Gemini) and google-vertex-anthropic (Claude) as GCP analogues of amazon-bedrock — ambient Google credentials, no injected API key — plus an optionsRequired schema addition so a caller-supplied option (the GCP project) with no usable default is validated at apply time.
Implement the proposal: google-vertex (Gemini) and google-vertex-anthropic (Claude), keyed by opencode's built-in ids so neither needs an npm package. Both authenticate via ambient Google credentials (ADC) and inject no API key, mirroring amazon-bedrock; they take a required project option and a location that defaults to global, from GOOGLE_VERTEX_PROJECT / GOOGLE_VERTEX_LOCATION. Add optionsRequired to the catalogue schema: BuildProviderBlock fails when a listed option resolves to nothing, naming the option and its env var. This guards a caller-supplied option with no usable default (the GCP project) on a keyless provider, which apiKeyRequired does not cover.
Add tests for the paths the initial change left uncovered: a required option satisfied by a static value and an unmapped required option (the catalogue-side error), taking BuildProviderBlock to full coverage; and CLI-level tests driving the whole add path — google-vertex-anthropic fails without GOOGLE_VERTEX_PROJECT and, once set, writes a block with project and the global location default and no apiKey — plus Pi rejection of both Vertex providers.
outofcoffee
marked this pull request as ready for review
August 1, 2026 00:32
Add runnable Outfit examples with walkthroughs for the ambient-credential cloud providers: Claude on amazon-bedrock, and Claude and Gemini on the new google-vertex-anthropic / google-vertex providers. Each README covers the credential setup (AWS creds; Google ADC plus GOOGLE_VERTEX_PROJECT) and applying the Outfit. The Outfits use MODEL alone — no ALIAS, which would replace the real model id opencode sends to the provider.
Merge the add-vertex-providers delta into the main provider-catalog spec (optionsRequired on Embedded provider definitions, plus the new Vertex AI providers requirement) and move the completed change to openspec/changes/archive/2026-08-01-add-vertex-providers.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds the GCP equivalent of AWS Bedrock: two Vertex AI providers, plus a small catalogue-schema addition. Implements the OpenSpec change
add-vertex-providers(all 12 tasks done).Providers
google-vertex— Gemini on Vertex AIgoogle-vertex-anthropic— Claude on Vertex AIBoth use opencode's built-in provider ids (no npm), authenticate via ambient Google credentials (ADC —
gcloud auth application-default loginorGOOGLE_APPLICATION_CREDENTIALS), and inject no API key — mirroringamazon-bedrock. Options:project(required) andlocation(defaultglobal), fromGOOGLE_VERTEX_PROJECT/GOOGLE_VERTEX_LOCATION. Neither has apiblock — Vertex needs OAuth/ADC, which the Pi harness doesn't support, so they're opencode-only.New
optionsRequiredcapabilityProvider.OptionsRequired []string:BuildProviderBlockfails when a listed option resolves to nothing, naming the option and its env var. Guards a caller-supplied option with no usable default (the GCP project) on a keyless provider —apiKeyRequiredonly covers the injected key.Verified
go test ./... -covergreen (catalog 92%, cmd/outfit 90.1%); gofmt clean.outfit listshows both (opencode-only);addwithoutGOOGLE_VERTEX_PROJECTfails with a clear error; with it set, writes a block withproject+location: globaland noapiKey.Files
internal/catalog/catalog.go,providers.yaml— schema field, validation, two providers, header docsinternal/catalog/catalog_test.go,cmd/outfit/main_test.go— tests + integrity invariantdocs/commands/add.md— Vertex examples + ADC noteopenspec/changes/add-vertex-providers/— proposal, design, specs, tasksStill a draft — ready to mark for review on your say-so.