anomalyco / anomalyco/opencode
Vertex Anthropic routing: google-vertex sends claude-* to publishers/google/ (404), and built-in subagent model bindings ignore user config
@nexxeln is already working on this.
Since Jul 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
Two related bugs in google-vertex provider handling of Claude (Anthropic) models on opencode 1.18.5:
- Wrong Vertex publisher namespace:
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. - Built-in subagent model bindings are hardcoded and ignore user config: The built-in subagents
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)- Adding
mode: subagentto the same block — mode field is accepted butmodelis still ignored - Removing
google-vertexfromenabled_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-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.- Built-in subagent default model ids should reference model versions that actually exist in the current catalog (e.g.,
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 .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/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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.