-
-
Notifications
You must be signed in to change notification settings - Fork 68.7k
Anthropic OAuth token spontaneously expires/fails to refresh #363
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Anthropic OAuth token spontaneously expires/fails to refresh
Environment
- Clawdbot version: 2026.1.5-3
- OS: macOS Tahoe 26.1
- Auth mode: OAuth (
anthropic:defaultwithmode: "oauth")
Description
The Anthropic OAuth token randomly fails to refresh without any user action. The error appears spontaneously:
Error: Error: Error: OAuth token refresh failed for anthropic: Failed to refresh OAuth token for anthropic. Please try again or re-authenticate.
This requires running pnpm clawdbot update to reset the OAuth, which is disruptive and happens frequently enough to be a significant pain point.
Steps to Reproduce
- Configure clawdbot with Anthropic OAuth authentication
- Use normally
- Wait (unclear trigger - happens spontaneously)
- OAuth stops working with the refresh error
Expected Behavior
- OAuth token refreshes automatically in the background
- Or graceful degradation with clear user prompt to re-auth
- Ideally: persistent auth that doesn't randomly break
Actual Behavior
- Token refresh fails unpredictably
- Requires manual intervention (
clawdbot update) to fix - No clear trigger or warning before failure
Config (relevant section)
{
"auth": {
"profiles": {
"anthropic:default": {
"provider": "anthropic",
"mode": "oauth"
}
}
}
}Questions for debugging
- Is there a token expiry log or timestamp I can check?
- Are there specific conditions that trigger this (time-based, request-based, network-based)?
- Is there a way to manually refresh without running
update?
Frequency
~4 times in the first 24 hours of use. Highly disruptive.
Log entries
2026-01-07T03:49:35.410Z - [gws] ⇄ res ✗ chat.send 316ms
errorCode=UNAVAILABLE
errorMessage=Error: OAuth token refresh failed for anthropic: Failed to refresh OAuth token for anthropic. Please try again or re-authenticate.
2026-01-07T03:52:15.491Z - [gws] ⇄ res ✗ chat.send 393ms
errorCode=UNAVAILABLE
errorMessage=Error: OAuth token refresh failed for anthropic: Failed to refresh OAuth token for anthropic. Please try again or re-authenticate.
Note: Two failures within 3 minutes of each other, suggesting the token was already bad and multiple requests hit it before the user could re-auth.
Workaround
Running pnpm clawdbot update resets the OAuth and fixes the issue temporarily.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.