Skip to content

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

Description

@sergical

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions