Skip to content

feat: Add AWS Bedrock LLM provider support with token auth#923

Merged
jaberjaber23 merged 1 commit intoRightNow-AI:mainfrom
smitb:feat/add-aws-bedrock-llm-provider-support-with-token-auth
Apr 10, 2026
Merged

feat: Add AWS Bedrock LLM provider support with token auth#923
jaberjaber23 merged 1 commit intoRightNow-AI:mainfrom
smitb:feat/add-aws-bedrock-llm-provider-support-with-token-auth

Conversation

@smitb
Copy link
Copy Markdown
Contributor

@smitb smitb commented Mar 30, 2026

Summary

Adds AWS Bedrock as a supported LLM provider via the Converse API using
Bedrock API Key bearer token authentication. Credentials resolve from
bedrock_api_key in config or AWS_BEARER_TOKEN_BEDROCK env var, with
region defaulting to us-east-1.

Changes

  • New bedrock.rs driver implementing the full LlmDriver trait (completions, streaming, tool use, token usage)
  • bedrock registered as a named provider in create_driver()
  • Bedrock added to the init wizard provider list, defaulting to anthropic.claude-sonnet-4-6

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable)

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

@Jengro777
Copy link
Copy Markdown

Quick feedback from the community:
https://github.com/librefang/librefang

drzow added a commit to drzow/openfang that referenced this pull request Apr 3, 2026
Bedrock's Converse API requires exact 1:1 matching between assistant
toolUse blocks and the subsequent user toolResult blocks. When message
history gets messy (e.g. after session repair), mismatches cause 400
errors. This adds validate_tool_pairing() which:

- Removes orphaned toolResult blocks not matching preceding assistant
- Deduplicates toolResult blocks with repeated tool_use_id
- Inserts synthetic error results for missing toolUse matches
- Replaces empty user messages with placeholder text

Inspired by RightNow-AI#923.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@jaberjaber23 jaberjaber23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Legitimate AWS Bedrock provider via Converse API. Well-structured 1136-line driver with proper bearer token auth (Zeroizing), complete LlmDriver trait implementation (completions, streaming, tool use, token usage), correct request/response type mappings, and clean error handling. Init wizard integration is correct. Please rebase on main.

@jaberjaber23 jaberjaber23 merged commit 2daaf92 into RightNow-AI:main Apr 10, 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.

3 participants