Skip to content

Add Bedrock support to ClaudeAgentSDKManager - #6

Open
sondermax wants to merge 1 commit into
SouthBridgeAI:release/alphafrom
sondermax:bedrock-shim
Open

Add Bedrock support to ClaudeAgentSDKManager#6
sondermax wants to merge 1 commit into
SouthBridgeAI:release/alphafrom
sondermax:bedrock-shim

Conversation

@sondermax

Copy link
Copy Markdown

Extend ClaudeAgentSDKManager to support AWS Bedrock Claude models by:

  1. Route Bedrock models to ClaudeAgentSDKManager

    • Update codon-runner to treat both "anthropic" and "amazon-bedrock" provider IDs as Claude models
    • Both providers now use the same ClaudeAgentSDKManager instead of attempting shim resolution
  2. Enable Bedrock mode in SDK

    • Detect Bedrock models in buildSDKOptions()
    • Set CLAUDE_CODE_USE_BEDROCK=1 environment variable
    • Pass through AWS credentials (AWS_PROFILE, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION, etc.)
  3. Add Bedrock authentication checks to self-test

    • Accept optional ModelInfo parameter in runSelfTest()
    • Verify AWS credentials are configured for Bedrock models
    • Check for AWS region configuration
    • Support multiple credential types: profile, access keys, bearer token, container credentials, web identity

The Claude Agent SDK already supports Bedrock via CLAUDE_CODE_USE_BEDROCK, so no SDK changes are needed. This implementation reuses the existing Claude execution path with Bedrock-specific configuration.

Model IDs like us.anthropic.claude-haiku-4-5-20251001-v1:0 are passed directly to the SDK, which handles regional Bedrock routing.

Extend ClaudeAgentSDKManager to support AWS Bedrock Claude models by:

1. Route Bedrock models to ClaudeAgentSDKManager
   - Update codon-runner to treat both "anthropic" and "amazon-bedrock"
     provider IDs as Claude models
   - Both providers now use the same ClaudeAgentSDKManager instead of
     attempting shim resolution

2. Enable Bedrock mode in SDK
   - Detect Bedrock models in buildSDKOptions()
   - Set CLAUDE_CODE_USE_BEDROCK=1 environment variable
   - Pass through AWS credentials (AWS_PROFILE, AWS_ACCESS_KEY_ID,
     AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION, etc.)

3. Add Bedrock authentication checks to self-test
   - Accept optional ModelInfo parameter in runSelfTest()
   - Verify AWS credentials are configured for Bedrock models
   - Check for AWS region configuration
   - Support multiple credential types: profile, access keys, bearer
     token, container credentials, web identity

The Claude Agent SDK already supports Bedrock via CLAUDE_CODE_USE_BEDROCK,
so no SDK changes are needed. This implementation reuses the existing
Claude execution path with Bedrock-specific configuration.

Model IDs like us.anthropic.claude-haiku-4-5-20251001-v1:0 are passed
directly to the SDK, which handles regional Bedrock routing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@sondermax

Copy link
Copy Markdown
Author

hey! took a stab at #3 - let me know if this is worth getting merged! i don't sling TS so happy to take notes and do things how y'all would like!

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.

1 participant