Skip to content

Conversation

@Fl0p
Copy link

@Fl0p Fl0p commented Jan 17, 2026

  • Detect CLAUDE_CODE_USE_BEDROCK env var for Bedrock auth
  • Hide OAuth login UI for Bedrock users (auth via AWS credentials)
  • Pass isBedrock flag through auth status to frontend

Summary by CodeRabbit

  • New Features

    • Added AWS Bedrock as an authentication option for Claude.
    • Authentication status now includes an isBedrock flag and reports method as "bedrock" when applicable.
    • Bedrock-authenticated accounts hide login/re-authentication controls in account settings.
  • Documentation

    • Expanded environment example with guidance and settings for enabling Bedrock and configuring model defaults.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Warning

Rate limit exceeded

@Fl0p has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Server adds an AWS Bedrock path for Claude auth controlled by CLAUDE_CODE_USE_BEDROCK, returning isBedrock and method: 'bedrock' when enabled; client includes isBedrock in Claude status; Account UI hides login/re-auth when isBedrock is true; .env.example documents Bedrock vars.

Changes

Cohort / File(s) Summary
Server — Claude auth/status
server/routes/cli-auth.js
Adds Bedrock branch: if CLAUDE_CODE_USE_BEDROCK is truthy, checkClaudeCredentials returns { authenticated: true, email: 'AWS Bedrock', isBedrock: true } and /claude/status sets method to 'bedrock'.
Client — Settings state
src/components/Settings.jsx
Includes data.isBedrock in the Claude auth status object (defaults to false when absent).
Client — Account UI
src/components/settings/AccountContent.jsx
Hides login/re-auth UI when authStatus.isBedrock is true and consolidates login button rendering into the login section.
Configuration — Example env
.env.example
Adds commented AWS Bedrock configuration block and related Anthropic/model toggles to the example environment file.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client (Settings UI)
  participant UI as Account UI
  participant Server as Server (/claude/status)
  participant Env as Env (CLAUDE_CODE_USE_BEDROCK)

  Client->>Server: GET /claude/status
  Note right of Server: Reads Env (CLAUDE_CODE_USE_BEDROCK)
  Env-->>Server: flag value
  alt CLAUDE_CODE_USE_BEDROCK == true
    Server-->>Client: { authenticated: true, email: "AWS Bedrock", isBedrock: true, method: "bedrock" }
  else
    Server-->>Client: { authenticated: ..., isBedrock: false, method: "credentials_file" }
  end
  Client->>UI: update authStatus (includes isBedrock)
  alt isBedrock == true
    UI-->>UI: hide login/re-auth controls
  else
    UI-->>UI: show login/re-auth controls
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I sniffed the env and found a light,
Bedrock hummed softly, skipping login's plight,
Badge on my chest, I hop into the cloud,
No extra clicks—my whiskers proud,
Carrots for code, and a moonbeam bright 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature being added: AWS Bedrock authentication support. It is concise, specific, and directly reflects the primary change across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Detect CLAUDE_CODE_USE_BEDROCK env var for Bedrock auth
- Hide OAuth login UI for Bedrock users (auth via AWS credentials)
- Pass isBedrock flag through auth status to frontend

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@Fl0p
Copy link
Author

Fl0p commented Jan 25, 2026

@claude please review

@Fl0p
Copy link
Author

Fl0p commented Jan 25, 2026

Screenshot 2026-01-25 at 20 30 23

@viper151 @blackmammoth

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.env.example:
- Around line 76-79: The .env.example contains duplicated active ANTHROPIC_MODEL
entries which causes the latter to silently override the former; remove one of
the active ANTHROPIC_MODEL lines so only a single default is uncommented (keep
alternatives commented), e.g., leave one ANTHROPIC_MODEL as the default and
comment the other(s) with a short description to avoid confusion for users
copying the file.

@viper151
Copy link
Contributor

@Fl0p could you please use shared/modelConstants.js to store the models? also would it be possible to add an option to set this up from the UI as well?

viper151 and others added 2 commits February 1, 2026 14:08
This commit refines the configuration setup for AWS Bedrock and Anthropic models in the `.env.example` file. Unnecessary Docker-specific configurations were removed, and a conditional structure was introduced for AWS Bedrock settings. The AWS region was changed to `eu-central-1`, and default Anthropic models are explicitly defined within the AWS Bedrock conditional block. Additionally, commented directives are provided for selecting default models for usage with Anthropic services, thereby improving clarity and usability of environment configurations.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.env.example:
- Around line 51-76: Remove the Bash control and export syntax in the
CLAUDE_CODE_USE_BEDROCK block and replace it with dotenv-friendly content:
remove the lines "if [[ ... ]]; then", "export ...", and "fi", keep only plain
KEY=VALUE entries such as CLAUDE_CODE_USE_BEDROCK, AWS_REGION, AWS_PROFILE,
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, ANTHROPIC_DEFAULT_SONNET_MODEL,
ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_MODEL,
and ANTHROPIC_SMALL_FAST_MODEL, and if you need to provide guidance about
enabling options or defaults, convert those notes into commented lines starting
with # so the file remains compatible with dotenv parsers.

Fl0p added 2 commits February 1, 2026 14:23
Refactor the AWS Bedrock and Anthropic model configuration section in the .env.example file to enhance clarity. Condensed the sections by removing redundant comments and grouping related configuration parameters together. Now, users can uncomment the lines for the desired setup and fill in the appropriate credentials easily. Included clear indicators for the start and end of the configuration block, making it straightforward to identify relevant sections for setting up AWS Bedrock and Anthropic models.
Included prerequisites for setting up the AWS Bedrock configuration in the .env.example file. The added comments guide users to ensure they have the AWS CLI installed and configured properly, either through 'aws configure' or via environment variables or IAM roles. These changes aim to facilitate setting up AWS Bedrock by providing necessary setup instructions directly in the environment example file.
@Fl0p
Copy link
Author

Fl0p commented Feb 1, 2026

@viper151
There only way to use AWS (and Vertex) to use anthropic models to configure everything's with ENV

BTW simplified .env.example and added more info in it

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.env.example:
- Around line 72-74: Replace the shell-style assignments in the .env example:
remove the leading "export" and any "$VARIABLE" expansions and instead provide
plain KEY=value entries using the actual model identifiers for ANTHROPIC_MODEL
and ANTHROPIC_SMALL_FAST_MODEL (e.g., set
ANTHROPIC_MODEL=<actual-sonnet-or-opus-model-string> and
ANTHROPIC_SMALL_FAST_MODEL=<actual-haiku-model-string>) so that ANTHROPIC_MODEL,
ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL,
ANTHROPIC_SMALL_FAST_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL are represented as
valid .env assignments users can uncomment directly.
🧹 Nitpick comments (1)
.env.example (1)

52-52: Remove extra blank line for cleaner formatting.

🧹 Proposed fix
 # - Or ensure AWS credentials are available via environment variables or IAM roles
-
 
 # To use AWS Bedrock instead of Anthropic API

Refactored the Anthropic model configuration section in the .env.example file to enhance clarity. Adjusted comments explaining default model usage and selection through the use of a startup switch command. Streamlined the model assignment process by removing the commented-out export statements and directly specifying model variables for streamlined configuration. These changes aim to simplify understanding and customization of Anthropic model setups for different inference profiles, especially focusing on European region prefixes.
@viper151
Copy link
Contributor

viper151 commented Feb 2, 2026

@Fl0p thanks for fixing these. Just one last question as I did a similar installation recently. Have you tried setting it up on claude code directly instead of this project? By following this https://code.claude.com/docs/en/amazon-bedrock#3-configure-claude-code I had aws working so adding the models here might not be needed at all.

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