[BUG] Extension 2.1.207 breaks Bedrock SSO auth (UnauthorizedException: Session token not found or invalid) — 2.1.206 works

Status Fixed / completed
Reported on v2.1.206
Maintainer reply None cached
Activity 10 comments · opened Jul 13, 2026 · closed Aug 19, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Regression: extension 2.1.206 works, 2.1.207 broken (confirmed by direct downgrade test)
Auth: AWS Bedrock via IAM Identity Center SSO (sso-session config), profile bedrock, region eu-west-2
Model: eu.anthropic.claude-opus-4-8
Symptom: extension chat panel fails every request with UnauthorizedException: Session token not found or invalid, ~24ms after dispatch — CLI (v2.1.201, and manually invoked from VS Code's own integrated terminal) works fine with identical credentials/model/profile
Log detail: GetCallerIdentity check succeeds first ("skipping AWS auth refresh command"), then failure specifically during "resolving default AWS provider chain" for the actual invoke
Ruled out: stale env vars, SSO cache staleness, static vs. SSO credentials, model ID validity, env/awsAuthRefresh settings — all confirmed fine independently
Related: #51108 (same CLI-works/extension-fails divergence, different environment/trigger)

What Should Happen?

Should not get UnauthorizedException for a valid session

Error Messages/Logs

Every request fails immediately with:

2026-07-13T10:23:48.635Z [DEBUG] [API:auth] AWS credential resolve start
2026-07-13T10:23:48.635Z [DEBUG] Fetching AWS caller identity for AWS auth refresh command
2026-07-13T10:23:49.542Z [DEBUG] Fetched AWS caller identity, skipping AWS auth refresh command
2026-07-13T10:23:49.542Z [DEBUG] [API:auth] AWS credential resolve done in 907ms
2026-07-13T10:23:49.542Z [DEBUG] [API:timing] dispatching to bedrock model=eu.anthropic.claude-opus-4-8[1m]
2026-07-13T10:23:49.543Z [DEBUG] [API:auth] resolving default AWS provider chain (region: eu-west-2)
2026-07-13T10:23:49.567Z [ERROR] API error (attempt 3/4): UnauthorizedException: Session token not found or invalid
2026-07-13T10:23:49.567Z [ERROR] Error in API request: UnauthorizedException: Session token not found or invalid

Note the ~24ms gap between dispatch (.543) and failure (.567) — too fast for a real network round-trip to Bedrock, suggesting the failure happens locally before the signed request is actually sent. Also note the GetCallerIdentity check succeeds first, then the failure occurs specifically during a *separate* "resolving default AWS provider chain" step for the actual invoke — suggesting the extension's request-signing path is not using the same resolved credentials as its own identity check.

Steps to Reproduce

Environment

  • OS: Linux
  • Extension version (broken): 2.1.207
  • Extension version (confirmed working): 2.1.206
  • Claude Code CLI version (confirmed working, run manually): v2.1.201
  • Auth method: AWS Bedrock via IAM Identity Center SSO (sso-session config block)
  • AWS profile: bedrock
  • Region: eu-west-2
  • Model: eu.anthropic.claude-opus-4-8

~/.aws/config

[profile bedrock]
sso_session = bedrock
sso_account_id = 921274142329
sso_role_name = BedrockInvoker
region = eu-west-2

[sso-session bedrock]
sso_start_url = https://d-906786c92b.awsapps.com/start
sso_region = us-east-1
sso_registration_scopes = sso:account:access

Claude Code settings (~/.claude/settings.json)

{
"awsAuthRefresh": "aws sso login --profile bedrock",
"env": {
"AWS_PROFILE": "bedrock",
"AWS_REGION": "eu-west-2"
},
"model": "eu.anthropic.claude-opus-4-8",
"effortLevel": "xhigh",
"theme": "dark"
}

Steps to reproduce

  1. Configure Bedrock access via AWS IAM Identity Center SSO as above.
  2. Run aws sso login --profile bedrock — succeeds.
  3. Open VS Code with the Claude Code extension (2.1.207) installed.
  4. Send any prompt via the extension's chat panel.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.206

Claude Code Version

2.1.207

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

9 Comments

mdankbar-yunex · 1 month ago

Confirming this on a separate setup, and adding a workaround that isn't in the thread yet.

Environment

  • Claude Code 2.1.207 — broken; 2.1.206 — works. AWS CLI (v2) invokes Bedrock fine with the identical profile.
  • Auth: IAM Identity Center (SSO) profile via AWS_PROFILE, CLAUDE_CODE_USE_BEDROCK=1.
  • Models pinned to per-user application inference profile ARNs (arn:aws:bedrock:<region>:<acct>:application-inference-profile/…) rather than bare us.anthropic.* inference-profile IDs — so this reproduces regardless of whether the model is a cross-region inference profile or an AIP ARN.
  • Settings follow the documented SSO pattern exactly:
  {
    "awsAuthRefresh": "aws sso login --profile <profile> --use-device-code",
    "env": {
      "CLAUDE_CODE_USE_BEDROCK": "1",
      "AWS_REGION": "eu-central-1",
      "AWS_PROFILE": "<profile>"
    }
  }

Workaround

Bypass the bundled SSO resolver and hand Claude Code materialized credentials from the AWS CLI:

"awsCredentialExport": "aws configure export-credentials --profile <profile> --format process"

With this set, requests succeed again.

zilingzhang · 1 month ago

For us, on 2.1.207 we found us-west-2 region hit this, but aws profile on us-east-1 is fine. (aws profile is our sso region while us-west-2 our profile region, confirmed 2.1.209 today fixed the issue for us.)

david-shibley-contentful · 1 month ago

We are encountering this same issue. Changing regions didn't help for us. Only downgrading to v2.1.206 works

magemello · 1 month ago

Same issue here

robwhiteston · 1 month ago

Also experiencing the same issue. Haven't tried switching regions, but, that isn't really an option for us. I'm having a colleague try downgrading to v2.2.202 (since I have a session at that version which is currently working).

robwhiteston · 1 month ago
"awsCredentialExport": "aws configure export-credentials --profile <profile> --format process"

I tried this out on MacOS (Tahoe 26.4) and it worked beautifully. This is preferrable to the downgrade I think.

paynerc-socure · 1 month ago

I came here to report this as well.

This report says CLI works and only the extension is affected — wanted to flag that plain CLI (v2.1.207, no VS Code) fails identically for me, which may mean the CLI claim needs re-checking, or this is two related bugs sharing a root cause.

Downgrading the CLI to 2.1.206 resolves the issue.

dgierez-auction · 1 month ago

Coming here to report this too. Rolled back to 2.1.204 and it works well as before.

rz-sensi · 1 month ago

Also affected, via a third client: Zed's external agent (@agentclientprotocol/claude-agent-acp), not just the CLI/VS Code extension. Same symptom, same timing pattern others reported.

Root cause per #76701's resolution: v2.1.208 fixed Bedrock auth for SSO profiles where sso_region differs from the Bedrock region — matches my config exactly (sso_region = eu-west-1, Bedrock region = us-west-2).

Flagging here because claude-agent-acp bundles its own @anthropic-ai/claude-agent-sdk dependency rather than the claude CLI binary, and its latest release (0.59.0, npm) still pins SDK 0.3.207 — pre-fix. So this stays broken for Zed users until that package updates its dependency, independent of the CLI/extension fix.

Showing cached comments. Read the full discussion on GitHub ↗