disabled_providers config for Bedrock ignored when AWS credentials available via environment variables #2914

Closed
opened 2026-02-16 17:37:46 -05:00 by yindo · 5 comments
Owner

Originally created by @jvdmeulen92 on GitHub (Nov 17, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When using aws-vault (or any other tool that sets AWS credentials via environment variables like AWS_ACCESS_KEY_ID, AWS_SESSION_TOKEN, etc.), the Bedrock provider is loaded and its models appear in /models, even though bedrock is explicitly listed in the disabled_providers configuration.

Expected Behavior

According to the official documentation:

The disabled_providers option accepts an array of provider IDs. When a provider is disabled:

  • It won't be loaded even if environment variables are set.
  • It won't be loaded even if API keys are configured through opencode auth login.
  • The provider's models won't appear in the model selection list.

Bedrock models should NOT appear in the model selection when bedrock is in disabled_providers, regardless of AWS credentials being available.

Actual Behavior

When AWS credentials are present in the environment (e.g., when logged in with aws-vault exec my-profile -- opencode), Bedrock models appear in /models despite the configuration.

OpenCode version

1.0.68

Steps to reproduce

  1. Add bedrock to disabled_providers in ~/.config/opencode/opencode.json:
{
  "$schema": "https://opencode.ai/config.json",
  "disabled_providers": ["bedrock"]
}
  1. Login with aws-vault (or set AWS credentials via environment variables):
aws-vault exec my-profile -- opencode
  1. Run /models command

  2. Observe that Bedrock models are shown in the list

Expected Result: No Bedrock models should appear

Actual Result: Bedrock models appear in the model selection

Screenshot and/or share link

No response

Operating System

macOS

Terminal

iTerm2

Originally created by @jvdmeulen92 on GitHub (Nov 17, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When using `aws-vault` (or any other tool that sets AWS credentials via environment variables like `AWS_ACCESS_KEY_ID`, `AWS_SESSION_TOKEN`, etc.), the Bedrock provider is loaded and its models appear in `/models`, even though `bedrock` is explicitly listed in the `disabled_providers` configuration. ## Expected Behavior According to the [official documentation](https://opencode.ai/docs/config/#disabled-providers): > The `disabled_providers` option accepts an array of provider IDs. When a provider is disabled: > - **It won't be loaded even if environment variables are set.** > - It won't be loaded even if API keys are configured through `opencode auth login`. > - The provider's models won't appear in the model selection list. Bedrock models should NOT appear in the model selection when `bedrock` is in `disabled_providers`, regardless of AWS credentials being available. ## Actual Behavior When AWS credentials are present in the environment (e.g., when logged in with `aws-vault exec my-profile -- opencode`), Bedrock models appear in `/models` despite the configuration. ### OpenCode version 1.0.68 ### Steps to reproduce 1. Add `bedrock` to `disabled_providers` in `~/.config/opencode/opencode.json`: ```json { "$schema": "https://opencode.ai/config.json", "disabled_providers": ["bedrock"] } ``` 2. Login with aws-vault (or set AWS credentials via environment variables): ```bash aws-vault exec my-profile -- opencode ``` 3. Run `/models` command 4. Observe that Bedrock models are shown in the list **Expected Result:** No Bedrock models should appear **Actual Result:** Bedrock models appear in the model selection ### Screenshot and/or share link _No response_ ### Operating System macOS ### Terminal iTerm2
yindo added the bug label 2026-02-16 17:37:46 -05:00
yindo closed this issue 2026-02-16 17:37:46 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 17, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3417: Similar issue where disabled_providers config is ignored - provider still loads despite being explicitly disabled in configuration

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 17, 2025): This issue might be a duplicate of existing issues. Please check: - #3417: Similar issue where disabled_providers config is ignored - provider still loads despite being explicitly disabled in configuration Feel free to ignore if none of these address your specific case.
Author
Owner

@OpeOginni commented on GitHub (Nov 17, 2025):

Hey @jvdmeulen92 I think the actual provider id is amazon-bedrock not just bedrock. Could you try that? Ill see if I can replicate the issue in the meantime.

@OpeOginni commented on GitHub (Nov 17, 2025): Hey @jvdmeulen92 I think the actual provider id is `amazon-bedrock` not just `bedrock`. Could you try that? Ill see if I can replicate the issue in the meantime.
Author
Owner

@jvdmeulen92 commented on GitHub (Nov 17, 2025):

Thanks for responding! Well, using bedrock without AWS env vars set, the Bedrock models stay nicely hidden.

@jvdmeulen92 commented on GitHub (Nov 17, 2025): Thanks for responding! Well, using `bedrock` without AWS env vars set, the Bedrock models stay nicely hidden.
Author
Owner

@rekram1-node commented on GitHub (Nov 17, 2025):

@jvdmeulen92 is this resolved then?

Btw you can run opencode models to see the "provider ids" in this case amazon-bedrock

@rekram1-node commented on GitHub (Nov 17, 2025): @jvdmeulen92 is this resolved then? Btw you can run `opencode models` to see the "provider ids" in this case amazon-bedrock
Author
Owner

@jvdmeulen92 commented on GitHub (Nov 17, 2025):

Works like a charm, thank you both!

@jvdmeulen92 commented on GitHub (Nov 17, 2025): Works like a charm, thank you both!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2914