openclaw - 💡(How to fix) Fix Model fallback does not trigger on auth/credential errors (ExpiredTokenException) [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69719Fetched 2026-04-22 07:49:02
View on GitHub
Comments
2
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×2

When the primary model provider (e.g. amazon-bedrock) returns an authentication error like ExpiredTokenException: The security token included in the request is expired, OpenClaw does not attempt to use the configured fallback model.

Error Message

2026-04-21T11:35:36.608+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired
2026-04-21T11:49:12.205+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired
2026-04-21T12:00:03.476+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired

Root Cause

When the primary model provider (e.g. amazon-bedrock) returns an authentication error like ExpiredTokenException: The security token included in the request is expired, OpenClaw does not attempt to use the configured fallback model.

Code Example

2026-04-21T11:35:36.608+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired
2026-04-21T11:49:12.205+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired
2026-04-21T12:00:03.476+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired
RAW_BUFFERClick to expand / collapse

Description

When the primary model provider (e.g. amazon-bedrock) returns an authentication error like ExpiredTokenException: The security token included in the request is expired, OpenClaw does not attempt to use the configured fallback model.

Expected behavior

OpenClaw should fall back to the next configured model (e.g. ollama/gemma4) when the primary provider returns auth errors (401, 403, expired tokens, etc.), just like it would for rate limits or network errors.

Actual behavior

The agent run fails immediately with the auth error. No fallback is attempted. The error repeats on every subsequent request (heartbeats, cron jobs, user messages) until credentials are manually refreshed.

Reproduction

  1. Configure amazon-bedrock as primary model with temporary session tokens
  2. Configure ollama/gemma4 as fallback via openclaw models fallbacks add ollama/gemma4
  3. Let the AWS session token expire
  4. Send a message — OpenClaw returns ExpiredTokenException without trying fallback

Logs

2026-04-21T11:35:36.608+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired
2026-04-21T11:49:12.205+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired
2026-04-21T12:00:03.476+00:00 [agent/embedded] embedded run agent end: isError=true model=us.anthropic.claude-opus-4-6-v1 provider=amazon-bedrock error=ExpiredTokenException: The security token included in the request is expired

Environment

  • OpenClaw: 2026.4.15
  • Primary: amazon-bedrock/us.anthropic.claude-opus-4-6-v1
  • Fallback: ollama/gemma4
  • OS: Debian 13 (Proxmox LXC)
  • Node: 24.14.1

extent analysis

TL;DR

Update the OpenClaw configuration to handle authentication errors as a fallback trigger.

Guidance

  • Review the OpenClaw documentation to ensure that authentication errors are properly configured as a fallback trigger.
  • Verify that the ollama/gemma4 fallback model is correctly configured and reachable.
  • Check the OpenClaw version (2026.4.15) for any known issues or updates related to fallback behavior.
  • Test the fallback mechanism with a different type of error (e.g., rate limit or network error) to isolate the issue.

Example

No code snippet is provided as the issue seems to be related to configuration rather than code.

Notes

The issue might be specific to the amazon-bedrock provider or the ExpiredTokenException error. Further investigation is needed to determine the root cause.

Recommendation

Apply a workaround by manually refreshing the credentials until the underlying issue is resolved, as there is no clear indication of a fixed version available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

OpenClaw should fall back to the next configured model (e.g. ollama/gemma4) when the primary provider returns auth errors (401, 403, expired tokens, etc.), just like it would for rate limits or network errors.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Model fallback does not trigger on auth/credential errors (ExpiredTokenException) [2 comments, 2 participants]