Skip to content

fix(server): recognize Bedrock-backed Claude as authenticated#3931

Open
PieterVanZyl-Dev wants to merge 1 commit into
pingdotgg:mainfrom
PieterVanZyl-Dev:fix/claude-bedrock-auth
Open

fix(server): recognize Bedrock-backed Claude as authenticated#3931
PieterVanZyl-Dev wants to merge 1 commit into
pingdotgg:mainfrom
PieterVanZyl-Dev:fix/claude-bedrock-auth

Conversation

@PieterVanZyl-Dev

@PieterVanZyl-Dev PieterVanZyl-Dev commented Jul 13, 2026

Copy link
Copy Markdown

What Changed

The claude provider verifies auth by probing the Claude Agent SDK initialization result. An Amazon Bedrock init is slower ( (measured p50 ~16.7s, p90 ~18.2s, max ~20.2s locally)

Note: It could be that Amazon Bedrock + Latency (the bedrock endpoints are in the US and I am authing from South Africa)

The 8s probe timeout expired mid-init, so the probe returned undefined and the provider was reported as "Could not verify authentication" a warning state that left it unselectable in the model picker.

Raise CAPABILITIES_PROBE_TIMEOUT_MS to 25s (above the measured p90 with headroom for the observed max) and surface the SDK AccountInfo.apiProvider, labeling apiProvider === "bedrock" as authenticated ("Amazon Bedrock"). Adds a unit test for the Bedrock path.

Why

Without this claude code with bedrock authentication does not initialize for me and I cannot use the provider, even though if I start claude code cli locally it works and runs fine. I kept this change scoped down to only adding the auth provider, I can test.

UI Changes

Before:
image

After:
image

Displaying the Authenticated Provider detail to match Codex.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • [N/A] I included a video for animation/interaction changes

Note

Low Risk
Scoped to Claude provider status probing and auth labeling; no changes to runtime generation or credential handling beyond allowing slower init to complete.

Overview
Fixes Claude provider health checks when the Agent SDK is configured for Amazon Bedrock instead of first-party Anthropic auth.

The capabilities probe timeout is raised from 8s to 25s so slow Bedrock initialization (AWS credential refresh) can finish before the probe is treated as failed. The SDK init result now reads AccountInfo.apiProvider; when it is "bedrock", auth is reported as authenticated with type bedrock and label Amazon Bedrock, using the same fallback pattern as Codex when subscription/token fields are absent.

A unit test asserts the Bedrock path returns ready with the expected auth metadata.

Reviewed by Cursor Bugbot for commit b766764. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Recognize Bedrock-backed Claude as authenticated in provider status

  • Adds apiProviderAuthMetadata helper in ClaudeProvider.ts that returns { type: "bedrock", label: "Amazon Bedrock" } when the SDK reports apiProvider === "bedrock".
  • checkClaudeProviderStatus now falls back to this helper when no subscription or token info is present, so Bedrock-backed connections are correctly labeled as authenticated.
  • probeClaudeCapabilities now surfaces apiProvider from the SDK initialization result so consumers can distinguish first-party from Bedrock backends.
  • Increases the capabilities probe timeout from 8s to 25s to accommodate slower Amazon Bedrock initialization.

Macroscope summarized b766764.

The Claude provider verifies auth by probing the Claude Agent SDK initialization result. Amazon Bedrock init is much slower than first-party auth (measured p50 ~16.7s, p90 ~18.2s, max ~20.2s locally, since the SDK boots the Bedrock backend and runs the awsAuthRefresh credential hook). The 8s probe timeout expired mid-init, so the probe returned undefined and the provider was reported as "Could not verify authentication" - a warning state that left it unselectable in the model picker.

Raise CAPABILITIES_PROBE_TIMEOUT_MS to 25s (above the measured p90 with headroom for the observed max) and surface the SDK AccountInfo.apiProvider, labeling apiProvider === "bedrock" as authenticated ("Amazon Bedrock"). Adds a unit test for the Bedrock path.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8d005caa-1c6b-40f6-ad0f-d0425db45cc2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jul 13, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Straightforward bug fix that adds a fallback authentication path for Bedrock-backed Claude. Changes are additive, well-documented, and include test coverage. The timeout increase is justified by documented initialization latency differences.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant