[BUG] Extension 2.1.207 breaks Bedrock SSO auth (UnauthorizedException: Session token not found or invalid) — 2.1.206 works
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
- Configure Bedrock access via AWS IAM Identity Center SSO as above.
- Run
aws sso login --profile bedrock— succeeds. - Open VS Code with the Claude Code extension (2.1.207) installed.
- 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_
Showing cached comments. Read the full discussion on GitHub ↗
9 Comments
Confirming this on a separate setup, and adding a workaround that isn't in the thread yet.
Environment
Workaround
Bypass the bundled SSO resolver and hand Claude Code materialized credentials from the AWS CLI:
With this set, requests succeed again.
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.)
We are encountering this same issue. Changing regions didn't help for us. Only downgrading to v2.1.206 works
Same issue here
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).
I tried this out on MacOS (Tahoe 26.4) and it worked beautifully. This is preferrable to the downgrade I think.
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.206resolves the issue.Coming here to report this too. Rolled back to 2.1.204 and it works well as before.
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_regiondiffers from the Bedrockregion— matches my config exactly (sso_region = eu-west-1, Bedrockregion = us-west-2).Flagging here because
claude-agent-acpbundles its own@anthropic-ai/claude-agent-sdkdependency rather than theclaudeCLI binary, and its latest release (0.59.0, npm) still pins SDK0.3.207— pre-fix. So this stays broken for Zed users until that package updates its dependency, independent of the CLI/extension fix.