From d1e4435111e018b6ce197f0d80c38125876453c6 Mon Sep 17 00:00:00 2001 From: Flop Date: Sat, 17 Jan 2026 15:20:09 +0100 Subject: [PATCH 1/6] feat: add AWS Bedrock authentication support - 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 --- server/routes/cli-auth.js | 13 ++++++- src/components/Settings.jsx | 3 +- src/components/settings/AccountContent.jsx | 41 ++++++++++++---------- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/server/routes/cli-auth.js b/server/routes/cli-auth.js index 1de309d6a..ce10116b0 100644 --- a/server/routes/cli-auth.js +++ b/server/routes/cli-auth.js @@ -14,7 +14,8 @@ router.get('/claude/status', async (req, res) => { return res.json({ authenticated: true, email: credentialsResult.email || 'Authenticated', - method: 'credentials_file' + method: credentialsResult.isBedrock ? 'bedrock' : 'credentials_file', + isBedrock: credentialsResult.isBedrock || false }); } @@ -75,6 +76,16 @@ router.get('/codex/status', async (req, res) => { }); async function checkClaudeCredentials() { + // Check if using AWS Bedrock - no OAuth needed + if (process.env.CLAUDE_CODE_USE_BEDROCK === '1' || + process.env.CLAUDE_CODE_USE_BEDROCK === 'true') { + return { + authenticated: true, + email: 'AWS Bedrock', + isBedrock: true + }; + } + try { const credPath = path.join(os.homedir(), '.claude', '.credentials.json'); const content = await fs.readFile(credPath, 'utf8'); diff --git a/src/components/Settings.jsx b/src/components/Settings.jsx index 9f541e946..87e1766a3 100644 --- a/src/components/Settings.jsx +++ b/src/components/Settings.jsx @@ -602,7 +602,8 @@ function Settings({ isOpen, onClose, projects = [], initialTab = 'agents' }) { authenticated: data.authenticated, email: data.email, loading: false, - error: data.error || null + error: data.error || null, + isBedrock: data.isBedrock || false }); } else { setClaudeAuthStatus({ diff --git a/src/components/settings/AccountContent.jsx b/src/components/settings/AccountContent.jsx index e9b2d3fe7..2f67b04cc 100644 --- a/src/components/settings/AccountContent.jsx +++ b/src/components/settings/AccountContent.jsx @@ -89,28 +89,31 @@ export default function AccountContent({ agent, authStatus, onLogin }) { -
-
-
-
- {authStatus?.authenticated ? t('agents.login.reAuthenticate') : t('agents.login.title')} -
-
- {authStatus?.authenticated - ? t('agents.login.reAuthDescription') - : t('agents.login.description', { agent: config.name })} + {/* Hide login section for Bedrock users */} + {!authStatus?.isBedrock && ( +
+
+
+
+ {authStatus?.authenticated ? t('agents.login.reAuthenticate') : t('agents.login.title')} +
+
+ {authStatus?.authenticated + ? t('agents.login.reAuthDescription') + : t('agents.login.description', { agent: config.name })} +
+
-
-
+ )} {authStatus?.error && (
From 1dc431ad1c8a65349bbfd181218b1a74d33094fc Mon Sep 17 00:00:00 2001 From: Flop Date: Sun, 25 Jan 2026 20:41:32 +0100 Subject: [PATCH 2/6] Add some env vars --- .env.example | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.env.example b/.env.example index 4b3cbbc2a..4d713b0b0 100755 --- a/.env.example +++ b/.env.example @@ -39,3 +39,43 @@ VITE_CONTEXT_WINDOW=160000 CONTEXT_WINDOW=160000 # VITE_IS_PLATFORM=false + +# ============================================================================= +# AWS BEDROCK CONFIGURATION (for Docker) +# ============================================================================= + +# Use AWS Bedrock instead of Anthropic API +# CLAUDE_CODE_USE_BEDROCK=1 + +# AWS Credentials +# AWS_REGION=us-east-1 +# AWS_ACCESS_KEY_ID=your-access-key-id +# AWS_SECRET_ACCESS_KEY=your-secret-access-key + +# Or use AWS Profile (uncomment volume ~/.aws in docker-compose.yml) +# AWS_PROFILE=default + +# ============================================================================= +# DOCKER CONFIGURATION +# ============================================================================= + +# Restrict project creation to /projects only (for Docker) +# WORKSPACES_ROOT=/projects + +# ============================================================================= + +# ============================================================================= +# ANTHROPIC MODEL CONFIGURATION +# ============================================================================= + +# Default Anthropic models (EU inference profiles) +ANTHROPIC_DEFAULT_SONNET_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" +ANTHROPIC_DEFAULT_OPUS_MODEL="eu.anthropic.claude-opus-4-5-20251101-v1:0" +ANTHROPIC_DEFAULT_HAIKU_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" + +# Using inference profile ID +ANTHROPIC_MODEL='eu.anthropic.claude-opus-4-5-20251101-v1:0' +ANTHROPIC_MODEL='eu.anthropic.claude-sonnet-4-5-20250929-v1:0' # default +#ANTHROPIC_MODEL='eu.anthropic.claude-sonnet-4-20250514-v1:0' #old +#ANTHROPIC_MODEL='eu.anthropic.claude-sonnet-4-5-20250929-v1:0' #new +ANTHROPIC_SMALL_FAST_MODEL='eu.anthropic.claude-haiku-4-5-20251001-v1:0' From 4c7dacfbef7926a338e27861666f2912ad84e995 Mon Sep 17 00:00:00 2001 From: Flop Date: Sun, 1 Feb 2026 14:18:58 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20AWS=20Bedro?= =?UTF-8?q?ck=20and=20Anthropic=20Configuration=20in=20.env.example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .env.example | 49 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/.env.example b/.env.example index 4d713b0b0..4977d2269 100755 --- a/.env.example +++ b/.env.example @@ -41,41 +41,36 @@ CONTEXT_WINDOW=160000 # VITE_IS_PLATFORM=false # ============================================================================= -# AWS BEDROCK CONFIGURATION (for Docker) +# AWS BEDROCK CONFIGURATION # ============================================================================= # Use AWS Bedrock instead of Anthropic API +# uncomment to use AWS Bedrock instead of Anthropic API # CLAUDE_CODE_USE_BEDROCK=1 -# AWS Credentials -# AWS_REGION=us-east-1 -# AWS_ACCESS_KEY_ID=your-access-key-id -# AWS_SECRET_ACCESS_KEY=your-secret-access-key +if [[ "$CLAUDE_CODE_USE_BEDROCK" == "1" ]]; then -# Or use AWS Profile (uncomment volume ~/.aws in docker-compose.yml) -# AWS_PROFILE=default + # AWS Credentials + # Or use AWS Profile (in ~/.aws/config and ~/.aws/credentials) -# ============================================================================= -# DOCKER CONFIGURATION -# ============================================================================= - -# Restrict project creation to /projects only (for Docker) -# WORKSPACES_ROOT=/projects + AWS_REGION=eu-central-1 + AWS_PROFILE=default + AWS_ACCESS_KEY_ID=your-access-key-id + AWS_SECRET_ACCESS_KEY=your-secret-access-key -# ============================================================================= + # ============================================================================= + # ANTHROPIC MODEL CONFIGURATION + # ============================================================================= -# ============================================================================= -# ANTHROPIC MODEL CONFIGURATION -# ============================================================================= + # Default Anthropic models (EU inference profiles) + # keep in mind that the models in different regions will have different prefixes + ANTHROPIC_DEFAULT_SONNET_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" + ANTHROPIC_DEFAULT_OPUS_MODEL="eu.anthropic.claude-opus-4-5-20251101-v1:0" + ANTHROPIC_DEFAULT_HAIKU_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" -# Default Anthropic models (EU inference profiles) -ANTHROPIC_DEFAULT_SONNET_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" -ANTHROPIC_DEFAULT_OPUS_MODEL="eu.anthropic.claude-opus-4-5-20251101-v1:0" -ANTHROPIC_DEFAULT_HAIKU_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" + # Assign exact models for claude to use + export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_SONNET_MODEL # default + # export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_OPUS_MODEL # uncomment to use opus as default + export ANTHROPIC_SMALL_FAST_MODEL=$ANTHROPIC_DEFAULT_HAIKU_MODEL -# Using inference profile ID -ANTHROPIC_MODEL='eu.anthropic.claude-opus-4-5-20251101-v1:0' -ANTHROPIC_MODEL='eu.anthropic.claude-sonnet-4-5-20250929-v1:0' # default -#ANTHROPIC_MODEL='eu.anthropic.claude-sonnet-4-20250514-v1:0' #old -#ANTHROPIC_MODEL='eu.anthropic.claude-sonnet-4-5-20250929-v1:0' #new -ANTHROPIC_SMALL_FAST_MODEL='eu.anthropic.claude-haiku-4-5-20251001-v1:0' +fi \ No newline at end of file From 20cc15a4ff235806db476ffaa919948ee3009eb2 Mon Sep 17 00:00:00 2001 From: Flop Date: Sun, 1 Feb 2026 14:23:16 +0100 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=94=A7=20Simplify=20AWS=20Bedrock=20a?= =?UTF-8?q?nd=20Anthropic=20model=20configuration=20in=20.env.example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .env.example | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/.env.example b/.env.example index 4977d2269..70bbcf608 100755 --- a/.env.example +++ b/.env.example @@ -41,36 +41,32 @@ CONTEXT_WINDOW=160000 # VITE_IS_PLATFORM=false # ============================================================================= -# AWS BEDROCK CONFIGURATION +# AWS BEDROCK CONFIGURATION & ANTHROPIC MODEL FOR AWS BEDROCK CONFIGURATION START # ============================================================================= -# Use AWS Bedrock instead of Anthropic API -# uncomment to use AWS Bedrock instead of Anthropic API +# To use AWS Bedrock instead of Anthropic API +# Uncomment the following lines and fill in the credentials # CLAUDE_CODE_USE_BEDROCK=1 -if [[ "$CLAUDE_CODE_USE_BEDROCK" == "1" ]]; then +# AWS Credentials +# Or use AWS Profile (in ~/.aws/config and ~/.aws/credentials) - # AWS Credentials - # Or use AWS Profile (in ~/.aws/config and ~/.aws/credentials) +# AWS_REGION=eu-central-1 +# AWS_PROFILE=default +# AWS_ACCESS_KEY_ID=your-access-key-id +# AWS_SECRET_ACCESS_KEY=your-secret-access-key - AWS_REGION=eu-central-1 - AWS_PROFILE=default - AWS_ACCESS_KEY_ID=your-access-key-id - AWS_SECRET_ACCESS_KEY=your-secret-access-key +# Default Anthropic models (EU inference profiles) +# keep in mind that the models in different regions will have different prefixes +# ANTHROPIC_DEFAULT_SONNET_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" +# ANTHROPIC_DEFAULT_OPUS_MODEL="eu.anthropic.claude-opus-4-5-20251101-v1:0" +# ANTHROPIC_DEFAULT_HAIKU_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" - # ============================================================================= - # ANTHROPIC MODEL CONFIGURATION - # ============================================================================= +# Assign exact models for claude to use +# export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_SONNET_MODEL # default +# export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_OPUS_MODEL # uncomment to use opus as default +# export ANTHROPIC_SMALL_FAST_MODEL=$ANTHROPIC_DEFAULT_HAIKU_MODEL - # Default Anthropic models (EU inference profiles) - # keep in mind that the models in different regions will have different prefixes - ANTHROPIC_DEFAULT_SONNET_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" - ANTHROPIC_DEFAULT_OPUS_MODEL="eu.anthropic.claude-opus-4-5-20251101-v1:0" - ANTHROPIC_DEFAULT_HAIKU_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" - - # Assign exact models for claude to use - export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_SONNET_MODEL # default - # export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_OPUS_MODEL # uncomment to use opus as default - export ANTHROPIC_SMALL_FAST_MODEL=$ANTHROPIC_DEFAULT_HAIKU_MODEL - -fi \ No newline at end of file +# ============================================================================= +# AWS BEDROCK CONFIGURATION & ANTHROPIC MODEL FOR AWS BEDROCK CONFIGURATION END +# ============================================================================= From 42e5375552859178a09ef4f22af0b666bc8e4cbc Mon Sep 17 00:00:00 2001 From: Flop Date: Sun, 1 Feb 2026 14:25:35 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=94=A7=20Add=20AWS=20Bedrock=20Config?= =?UTF-8?q?uration=20Prerequisites=20to=20.env.example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .env.example | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.env.example b/.env.example index 70bbcf608..87543da66 100755 --- a/.env.example +++ b/.env.example @@ -44,6 +44,12 @@ CONTEXT_WINDOW=160000 # AWS BEDROCK CONFIGURATION & ANTHROPIC MODEL FOR AWS BEDROCK CONFIGURATION START # ============================================================================= +# Prerequisites: +# - AWS CLI must be installed and configured +# - Run 'aws configure' to set up your credentials and default region +# - Or ensure AWS credentials are available via environment variables or IAM roles + + # To use AWS Bedrock instead of Anthropic API # Uncomment the following lines and fill in the credentials # CLAUDE_CODE_USE_BEDROCK=1 From 7ef06dde415e0aaf2690acfa9e3bbc8ac0fb0092 Mon Sep 17 00:00:00 2001 From: Flop Date: Sun, 1 Feb 2026 14:34:01 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Update=20.env.example?= =?UTF-8?q?=20with=20model=20selection=20details?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .env.example | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 87543da66..7e7563bdd 100755 --- a/.env.example +++ b/.env.example @@ -62,16 +62,15 @@ CONTEXT_WINDOW=160000 # AWS_ACCESS_KEY_ID=your-access-key-id # AWS_SECRET_ACCESS_KEY=your-secret-access-key -# Default Anthropic models (EU inference profiles) +# Default Anthropic models for switching using /model command (EU inference profiles) # keep in mind that the models in different regions will have different prefixes # ANTHROPIC_DEFAULT_SONNET_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" # ANTHROPIC_DEFAULT_OPUS_MODEL="eu.anthropic.claude-opus-4-5-20251101-v1:0" # ANTHROPIC_DEFAULT_HAIKU_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" -# Assign exact models for claude to use -# export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_SONNET_MODEL # default -# export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_OPUS_MODEL # uncomment to use opus as default -# export ANTHROPIC_SMALL_FAST_MODEL=$ANTHROPIC_DEFAULT_HAIKU_MODEL +# Assign exact models for claude to use from startup +# ANTHROPIC_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" +# ANTHROPIC_SMALL_FAST_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" # ============================================================================= # AWS BEDROCK CONFIGURATION & ANTHROPIC MODEL FOR AWS BEDROCK CONFIGURATION END