Summary
Two related bugs in google-vertex provider handling of Claude (Anthropic) models on opencode 1.18.5:
- Wrong Vertex publisher namespace:
google-vertex provider routes claude-* model requests to publishers/google/models/<claude-model> on Vertex, but Anthropic models on Vertex live at publishers/anthropic/models/<claude-model>. All Claude calls under google-vertex return Publisher model ... was not found.
- Built-in subagent model bindings are hardcoded and ignore user config: The built-in subagents
explore, general, junior-software-engineer, ops-debugger, qa-engineer are pinned to google-vertex/claude-haiku-4-5 (a non-existent model id — the current catalog only has claude-haiku-4-5@20251001). No user-config path can override this binding:
agent.<name>.model in opencode.jsonc — silently ignored
model: frontmatter in ~/.config/opencode/agents/<name>.md — silently ignored (verified by setting it to FAKE/xyz with no effect on the resolved config)
- Adding
mode: subagent to the same block — mode field is accepted but model is still ignored
- Removing
google-vertex from enabled_providers — still stuck
The same config shape works perfectly for any custom agent name (verified by adding an agent mycustom with the same config — resolved correctly).
Environment
- opencode 1.18.5 (brew,
/opt/homebrew/bin/opencode)
- macOS 14.5 (Darwin 25.5.0)
- Vertex project: uses ADC auth via
gcloud auth application-default login
- providers enabled:
google-vertex-anthropic, google-vertex, github-copilot
Reproduction
~/.config/opencode/opencode.jsonc:
Run:
GOOGLE_VERTEX_PROJECT=<PROJECT> GOOGLE_VERTEX_LOCATION=global opencode debug config
Actual
agent.explore.model = google-vertex/claude-haiku-4-5 ← ignored user config
agent.mycustom.model = google-vertex-anthropic/claude-haiku-4-5@20251001 ← honored
Invoking explore as a subagent then fails at runtime:
AI_APICallError: Publisher model
`projects/<PROJECT>/locations/us-central1/publishers/google/models/claude-sonnet-4-6`
was not found or your project does not have access to it.
and separately:
ProviderModelNotFoundError: Model not found: google-vertex/claude-haiku-4-5.
Did you mean: claude-haiku-4-5@20251001?
Note the location us-central1 in the URL even though region: "global" is set in the provider options — the region field also seems to be ignored for google-vertex.
Expected
google-vertex provider should either route claude-* models to publishers/anthropic/ OR reject claude-* model ids with a clear "use google-vertex-anthropic instead" error.
agent.<name>.model config for built-in subagent names should override the built-in defaults.
- Built-in subagent default model ids should reference model versions that actually exist in the current catalog (e.g.,
claude-haiku-4-5@20251001 rather than the versionless claude-haiku-4-5).
provider.<name>.options.region should be respected.
Impact
Any user with a Vertex-anchored Claude setup can't use the built-in Haiku subagents (explore, general, junior-software-engineer, ops-debugger, qa-engineer) at all. Delegated work through these agent names fails immediately. Custom-named "shadow" agents work as a workaround.
Workaround
Duplicate each built-in .md under a new name (e.g., explore-vx.md with name: explore-vx) with model: google-vertex-anthropic/claude-haiku-4-5@20251001, then always call them via subagent_type=<name>-vx from the task tool. Full config for the custom name is honored. Users must remember to prefer the shadow, and skills/scripts that hardcode built-in names still break.
Related
- Bundled
@ai-sdk/google-vertex/anthropic provider (google-vertex-anthropic) works correctly out of the box for Claude on Vertex — this is the code path the built-in agents should be using.
strings /opt/homebrew/bin/opencode | grep -c "publishers/anthropic/models" returns matches, so the correct code path is compiled in.
Summary
Two related bugs in
google-vertexprovider handling of Claude (Anthropic) models on opencode 1.18.5:google-vertexprovider routesclaude-*model requests topublishers/google/models/<claude-model>on Vertex, but Anthropic models on Vertex live atpublishers/anthropic/models/<claude-model>. All Claude calls undergoogle-vertexreturnPublisher model ... was not found.explore,general,junior-software-engineer,ops-debugger,qa-engineerare pinned togoogle-vertex/claude-haiku-4-5(a non-existent model id — the current catalog only hasclaude-haiku-4-5@20251001). No user-config path can override this binding:agent.<name>.modelinopencode.jsonc— silently ignoredmodel:frontmatter in~/.config/opencode/agents/<name>.md— silently ignored (verified by setting it toFAKE/xyzwith no effect on the resolved config)mode: subagentto the same block — mode field is accepted butmodelis still ignoredgoogle-vertexfromenabled_providers— still stuckThe same config shape works perfectly for any custom agent name (verified by adding an agent
mycustomwith the same config — resolved correctly).Environment
/opt/homebrew/bin/opencode)gcloud auth application-default logingoogle-vertex-anthropic,google-vertex,github-copilotReproduction
~/.config/opencode/opencode.jsonc:{ "$schema": "https://opencode.ai/config.json", "model": "google-vertex-anthropic/claude-sonnet-4-6", "enabled_providers": ["google-vertex-anthropic", "google-vertex"], "provider": { "google-vertex-anthropic": { "options": { "project": "<PROJECT>", "location": "global" } } }, "agent": { "explore": { "model": "google-vertex-anthropic/claude-haiku-4-5@20251001" }, "mycustom": { "model": "google-vertex-anthropic/claude-haiku-4-5@20251001" } } }Run:
Actual
Invoking
exploreas a subagent then fails at runtime:and separately:
Note the location
us-central1in the URL even thoughregion: "global"is set in the provider options — theregionfield also seems to be ignored forgoogle-vertex.Expected
google-vertexprovider should either routeclaude-*models topublishers/anthropic/OR rejectclaude-*model ids with a clear "usegoogle-vertex-anthropicinstead" error.agent.<name>.modelconfig for built-in subagent names should override the built-in defaults.claude-haiku-4-5@20251001rather than the versionlessclaude-haiku-4-5).provider.<name>.options.regionshould be respected.Impact
Any user with a Vertex-anchored Claude setup can't use the built-in Haiku subagents (
explore,general,junior-software-engineer,ops-debugger,qa-engineer) at all. Delegated work through these agent names fails immediately. Custom-named "shadow" agents work as a workaround.Workaround
Duplicate each built-in
.mdunder a new name (e.g.,explore-vx.mdwithname: explore-vx) withmodel: google-vertex-anthropic/claude-haiku-4-5@20251001, then always call them viasubagent_type=<name>-vxfrom the task tool. Full config for the custom name is honored. Users must remember to prefer the shadow, and skills/scripts that hardcode built-in names still break.Related
@ai-sdk/google-vertex/anthropicprovider (google-vertex-anthropic) works correctly out of the box for Claude on Vertex — this is the code path the built-in agents should be using.strings /opt/homebrew/bin/opencode | grep -c "publishers/anthropic/models"returns matches, so the correct code path is compiled in.