Skip to content

Add Vertex AI providers (google-vertex, google-vertex-anthropic) + optionsRequired - #23

Merged
outofcoffee merged 5 commits into
mainfrom
worktree-add-vertex-providers
Aug 1, 2026
Merged

outofcoffee merged 5 commits into
mainfrom
worktree-add-vertex-providers

Conversation

@outofcoffee

@outofcoffee outofcoffee commented Jul 30, 2026 •

Copy link
Copy Markdown
Collaborator

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 AI
  • google-vertex-anthropic — Claude on Vertex AI

Both use opencode's built-in provider ids (no npm), authenticate via ambient Google credentials (ADC — gcloud auth application-default login or GOOGLE_APPLICATION_CREDENTIALS), and inject no API key — mirroring amazon-bedrock. Options: project (required) and location (default global), from GOOGLE_VERTEX_PROJECT / GOOGLE_VERTEX_LOCATION. Neither has a pi block — Vertex needs OAuth/ADC, which the Pi harness doesn't support, so they're opencode-only.

New optionsRequired capability

Provider.OptionsRequired []string: BuildProviderBlock fails 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 — apiKeyRequired only covers the injected key.

Verified

  • go test ./... -cover green (catalog 92%, cmd/outfit 90.1%); gofmt clean.
  • Drove the built binary: outfit list shows both (opencode-only); add without GOOGLE_VERTEX_PROJECT fails with a clear error; with it set, writes a block with project + location: global and no apiKey.

Files

  • internal/catalog/catalog.go, providers.yaml — schema field, validation, two providers, header docs
  • internal/catalog/catalog_test.go, cmd/outfit/main_test.go — tests + integrity invariant
  • docs/commands/add.md — Vertex examples + ADC note
  • openspec/changes/add-vertex-providers/ — proposal, design, specs, tasks

Still a draft — ready to mark for review on your say-so.

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.
@outofcoffee outofcoffee changed the title Propose: Vertex AI providers + optionsRequired Add Vertex AI providers (google-vertex, google-vertex-anthropic) + optionsRequired Aug 1, 2026
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
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.
@outofcoffee
outofcoffee merged commit 07085f6 into main Aug 1, 2026
1 check passed
@outofcoffee
outofcoffee deleted the worktree-add-vertex-providers branch August 1, 2026 01:04
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.

1 participant