anomalyco / anomalyco/opencode
[FEATURE]: Amazon Bedrock — support a second profile/account and reach Mantle Responses API from a non-"amazon-bedrock" provider
@jlongster is already working on this.
Since Jul 28, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Follow-up to #30993 / #31001 (thanks for the Mantle fix). Two related limits show up when using Bedrock Mantle across two AWS accounts, on opencode 1.18.8:
1. One profile per provider. The SSO/profile credential chain (fromNodeProviderChain({ profile })) is wired only into the loader keyed to the literal id amazon-bedrock (provider.ts#L294-L352). I run Claude on account A and the Mantle GPT-5.x models on account B. A second, differently-named provider can't resolve a profile — it falls through to generic handling with no credentialProvider, so it only works with static SigV4 keys.
2. Responses API only reachable via id amazon-bedrock. selectBedrockMantleLanguageModel (which picks .responses() vs .chat()) is dispatched only from that same loader (L368 → L162-L166). Under any other provider id, Mantle models default to .chat(), so Responses-only models (gpt-5.x) return 400 "does not support /v1/chat/completions". Chat-only Mantle models (qwen etc.) do work via a second provider with static keys.
Plugins can't bridge this — ProviderHook only exposes model discovery, not a custom SDK/credential provider (plugin/src/index.ts#L214-L217).
Possible directions (or tell me I'm wrong):
- allow a per-model/per-config profile under
amazon-bedrock, and/or - fire the Mantle responses/chat selector based on
model.api.npm === "@ai-sdk/amazon-bedrock/mantle"regardless of provider id.
Docs: the providers page currently documents only the standard Bedrock options (region/profile/endpoint); the Mantle path (npm: "@ai-sdk/amazon-bedrock/mantle", /openai/v1 base URL, Responses routing) isn't documented anywhere. Worth adding once the above is settled.
If there's already a supported way to do multi-account Bedrock + Mantle Responses today, I'll gladly just use that.
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.