Skip to content

Conversation

@wnkz
Copy link
Contributor

@wnkz wnkz commented Dec 29, 2025

Summary

Adds configuration file support for Amazon Bedrock provider with profile, region, and endpoint options. Documents authentication precedence to clarify that bearer tokens take priority over AWS credential chain methods.

Changes

Provider Configuration (provider.ts)

  • Added support for profile, region, and endpoint options in opencode.json
  • Implemented precedence logic: config file options override environment variables
  • Profile option now passed to fromNodeProviderChain() for proper credential resolution

Tests (amazon-bedrock.test.ts)

  • Added 4 tests covering config precedence scenarios
  • Tests verify profile precedence, endpoint configuration, and combined options

Documentation (config.mdx, providers.mdx)

  • Added "Provider-Specific Options" section to config docs
  • Added "Authentication Precedence" section to providers docs
  • Documents that bearer tokens (AWS_BEARER_TOKEN_BEDROCK or /connect) take precedence over credential chain

CLI (auth.ts)

  • Updated /connect amazon-bedrock help message to show clear credential priority order

Configuration Example

{
  "provider": {
    "amazon-bedrock": {
      "options": {
        "region": "us-east-1",
        "profile": "my-aws-profile",
        "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com"
      }
    }
  }
}

Authentication Precedence

  1. Bearer token (AWS_BEARER_TOKEN_BEDROCK or /connect)
  2. AWS credential chain (profile, access keys, IAM roles)

Notes:

  • Follows existing patterns for provider configuration
  • Maintains backward compatibility with environment variable configuration
  • Configuration file options take precedence over environment variables (except bearer tokens)

@wnkz
Copy link
Contributor Author

wnkz commented Dec 29, 2025

I don't think the typecheck issue comes from here, happy to rebase when fixed upstream

@rekram1-node
Copy link
Collaborator

ill fix

@wnkz wnkz force-pushed the ft-improve-bedrock-configuration branch from 0e540c4 to d9f2600 Compare December 29, 2025 19:32
@wnkz wnkz marked this pull request as draft December 29, 2025 19:33
@wnkz wnkz force-pushed the ft-improve-bedrock-configuration branch from d9f2600 to 947ed98 Compare December 29, 2025 19:35
@wnkz wnkz marked this pull request as ready for review December 29, 2025 19:37
@rekram1-node
Copy link
Collaborator

/review

@wnkz wnkz force-pushed the ft-improve-bedrock-configuration branch from 947ed98 to c7c531a Compare January 5, 2026 18:20
@wnkz
Copy link
Contributor Author

wnkz commented Jan 5, 2026

@rekram1-node rebased the branch and tried to address the comments from gh actions ✌🏻

@rekram1-node rekram1-node merged commit e3b4d4a into anomalyco:dev Jan 5, 2026
2 checks passed
ryanwyler pushed a commit to gignit/opencode that referenced this pull request Jan 6, 2026
ruuxi pushed a commit to ruuxi/ngmicode that referenced this pull request Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants