Skip to content

Vertex Anthropic routing: google-vertex sends claude-* to publishers/google/ (404), and built-in subagent model bindings ignore user config #39069

Description

@navidRashik

Summary

Two related bugs in google-vertex provider handling of Claude (Anthropic) models on opencode 1.18.5:

  1. 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.
  2. 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:

{
  "$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:

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions