feat: Bedrock support for Claude adapter#1
Merged
dafzthomas merged 28 commits intomainfrom Mar 18, 2026
Merged
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
- drop `cursor` from provider/model contracts and runtime validation - remove Cursor-specific UI options, settings, and model normalization paths - update server/web tests and fixtures to cover Codex + Claude Code only
- Include Claude Code in available provider options in the picker - Add Cursor as a disabled placeholder provider with icon mapping - Update session-logic tests to assert provider availability and ordering
- Map Claude reasoning deltas, streamed tool input JSON, and tool results into runtime item/content events - Classify Agent/read-only Claude tools for correct approval request types - Add Claude CLI provider health checks and auth-status parsing coverage Co-authored-by: codex <codex@users.noreply.github.com>
- Reject turn starts that request a provider switch from the thread-bound provider - Reject models that do not belong to the thread provider and log start failures - Add shared `inferProviderForModel` helper and tests; reuse it in web store inference
- Use thread provider as the preferred provider during command handling - Update `ProviderModelPicker` to show direct model choices when provider is locked - Add browser tests for locked/unlocked picker behavior and widen browser test glob
- derive `defaultModel` from `DEFAULT_MODEL_BY_PROVIDER` using harness provider - replace hardcoded `gpt-5-codex` in seeded project and thread setup
- Persist selected provider and model in the composer draft before clearing content on send, so the draft survives shouldRemoveDraft and the provider selection is not lost between renders - Use provider-aware DEFAULT_MODEL_BY_PROVIDER[selectedProvider] fallback instead of hard-coded DEFAULT_MODEL_BY_PROVIDER.codex in thread creation and plan implementation flows Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Bedrock settings to app settings schema (useBedrock, awsRegion, awsProfile, bedrockModelOverride ARNs for Haiku/Sonnet/Opus) - Add Bedrock settings UI section in settings page with toggle, region/profile inputs, and ARN override fields - Wire Bedrock provider options through ChatView dispatch to server - Pass Bedrock env vars (CLAUDE_CODE_USE_BEDROCK, AWS_REGION, etc.) to SDK query options in ClaudeAdapter - Show "Bedrock" prefix on model names when Bedrock is enabled - Show "Claude Bedrock" label in provider picker when Bedrock is enabled - Add Bedrock fields to ClaudeProviderStartOptions contract Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add resolveBedrockModel() to ClaudeAdapter that maps friendly model slugs (e.g. claude-sonnet-4-6) to Bedrock ARN overrides when CLAUDE_CODE_USE_BEDROCK is enabled. Passing friendly slugs directly causes a 400 from the Bedrock API. - Apply model resolution in both startSession and sendTurn paths; skip setModel() when resolved model is undefined to let the CLI use its built-in Bedrock default. - Sync AWS/Bedrock env vars (AWS_PROFILE, AWS_REGION, credentials, CLAUDE_CODE_USE_BEDROCK, model overrides) from login shell in desktop syncShellEnvironment. - Add BedrockShellDefaults schema to contracts and expose it via serverGetConfig so the web UI can detect shell-based Bedrock config. - Settings UI auto-detects Bedrock enabled via shell env, shows shell defaults as placeholders, and displays explanatory text. - ChatView passes bedrockShellDefaults to ProviderModelPicker for the Bedrock badge and provider label overrides. - Show BEDROCK badge in the composer model picker button when Bedrock is active. - Update wsServer tests to use expect.objectContaining to accommodate optional bedrockShellDefaults field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f9d59ecef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- mockServiceWorker.js: keep newer version (2.12.11) - appSettings.ts: keep Bedrock fields alongside new textGenerationModel - model.ts: keep backward compat exports alongside new DEFAULT_GIT_TEXT_GENERATION_MODEL Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- resolveBedrockModel now only rewrites known friendly slugs (haiku, sonnet, opus) and passes through custom model IDs (e.g. ARNs) as-is - sendTurn uses the session-scoped env (context.sessionEnv) instead of process.env, so UI-provided Bedrock overrides are respected consistently with startSession - Store baseEnv as sessionEnv on ClaudeSessionContext for turn-time model resolution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds full AWS Bedrock support for the Claude Code adapter (
claudeAgentprovider), enabling Claude models to be used via Bedrock inference profiles instead of the default Anthropic API.Bedrock model resolution
claude-sonnet-4-6) cause a 400 from the Bedrock API — they must be mapped to Bedrock ARN/model IDsresolveBedrockModel()inClaudeAdapter.tsmaps slugs to configured Bedrock ARN overrides (via UI settings or env vars), or omits the model to let the CLI use its built-in defaultstartSessionandsendTurnpathsShell environment sync
syncShellEnvironmentnow syncs AWS/Bedrock env vars (AWS_PROFILE,AWS_REGION,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN,CLAUDE_CODE_USE_BEDROCK,CLAUDE_CODE_BEDROCK_MODEL_*) from the login shellBedrockShellDefaultsviaserverGetConfigso the web UI can detect shell-based Bedrock configurationSettings UI improvements
Chat bar indicator
BEDROCKbadge in the composer model picker when Bedrock is activeConfiguration
To use Bedrock, either:
CLAUDE_CODE_USE_BEDROCK=1in your shell environment, orThen configure Bedrock Model ARN overrides pointing to inference profiles your IAM role has access to (e.g. application inference profiles).
Test plan
bun run typecheck— 7/7 packages passbun run test— 490/490 tests passenvis passed toquery()