fix(server): recognize Bedrock-backed Claude as authenticated#3931
fix(server): recognize Bedrock-backed Claude as authenticated#3931PieterVanZyl-Dev wants to merge 1 commit into
Conversation
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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: 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. |
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:

After:

Displaying the Authenticated Provider detail to match Codex.
Checklist
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 typebedrockand label Amazon Bedrock, using the same fallback pattern as Codex when subscription/token fields are absent.A unit test asserts the Bedrock path returns
readywith 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
apiProviderAuthMetadatahelper in ClaudeProvider.ts that returns{ type: "bedrock", label: "Amazon Bedrock" }when the SDK reportsapiProvider === "bedrock".checkClaudeProviderStatusnow falls back to this helper when no subscription or token info is present, so Bedrock-backed connections are correctly labeled as authenticated.probeClaudeCapabilitiesnow surfacesapiProviderfrom the SDK initialization result so consumers can distinguish first-party from Bedrock backends.Macroscope summarized b766764.