anomalyco / anomalyco/opencode

[BUG]: Bedrock Mantle models unreachable on v2 — ${AWS_REGION} in base URL is never substituted

Open
#40,075 4 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 2, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

On the v2 path, openai.* Bedrock models (GPT-5.6 Sol/Terra/Luna, gpt-oss) can never connect. The catalog advertises the Mantle endpoint as a template, https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1, and nothing substitutes it, so the request goes to that literal hostname:

Cannot connect to API: Unable to connect. Is the computer able to access the url?
Cannot connect to API: Was there a typo in the url or port?

v1 is fine — packages/opencode/src/provider/provider.ts expands it via the bedrock loader's vars() hook (added in #31001), and provider.ts:1712 does the replacement. The v2 plugin, packages/core/src/plugin/provider/amazon-bedrock.ts, resolves a region for the SDK but leaves options.baseURL untouched; packages/core/src/aisdk.ts:80 assigns model.api.url verbatim. Other v2 plugins expand their own templates (google-vertex.ts:78, cloudflare-workers-ai.ts:64), bedrock just does not.

Same class of bug likely affects the other templated catalog URLs on v2 (${SNOWFLAKE_ACCOUNT}, ${DATABRICKS_HOST}, ${NEON_AI_GATEWAY_BASE_URL}) — none of those plugins expand either. Happy to keep this issue scoped to bedrock.

OpenCode version

opencode2 0.0.0-next-16420 (the v2 binary from @opencode-ai/cli). Also confirmed by reading dev at 1.18.11, where the failing test below was written.

Steps to reproduce
  1. Configure amazon-bedrock with any working auth and "region": "us-east-1".
  2. Select openai.gpt-5.6-sol on v2.
  3. Send a prompt — it fails to connect. The resolved URL is https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1/responses.
Operating System

macOS 26.5.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.