Skip to content

Bug: Anthropic OAuth refresh intermittently fails across chats/topics #44616

@IIIyban

Description

@IIIyban

Bug Report: Anthropic OAuth refresh fails intermittently across Telegram topics

  • Date (UTC): 2026-03-13 03:40:11
  • OpenClaw version: OpenClaw 2026.3.11 (29dc654)
  • Default model: openai-codex/gpt-5.3-codex

Symptom

Agent fails before reply in some chats/topics with:
OAuth token refresh failed for anthropic: Failed to refresh OAuth token for anthropic

Reproduction (observed)

  1. Anthropic model enabled globally (opus alias).
  2. Fresh Claude login completed successfully.
  3. In some Telegram topics requests still fail with OAuth refresh error.
  4. Manual sync from ~/.claude/.credentials.json to auth-profiles sometimes restores temporarily.

Expected

If credentials are valid, refresh should be consistent across all chats/topics and not require manual resync.

Actual

OAuth refresh is flaky/inconsistent; some topics fail while global status may look valid.

Diagnostics

models status --probe

Config        : ~/.openclaw/openclaw.json
Agent dir     : ~/.openclaw/agents/main/agent
Default       : openai-codex/gpt-5.3-codex
Fallbacks (0) : -
Image model   : -
Image fallbacks (0): -
Aliases (2)   : opus -> anthropic/claude-opus-4-6, sonnet -> anthropic/claude-sonnet-4-6
Configured models (7): openai-codex/gpt-5.3-codex, openrouter/stepfun/step-3.5-flash:free, openrouter/nvidia/nemotron-3-nano-30b-a3b:free, routerai/qwen/qwen3-235b-a22b-thinking-2507, openai-codex/gpt-5.2-codex, anthropic/claude-opus-4-6, anthropic/claude-sonnet-4-6

Auth overview
Auth store    : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env     : off
Providers w/ OAuth/tokens (2): anthropic (1), openai-codex (1)
- anthropic effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=1, token=0, api_key=0) | anthropic:default=OAuth
- openai-codex effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=1, token=0, api_key=0) | openai-codex:default=OAuth
- openrouter effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | openrouter:default=sk-or-v1...d945a06b | env=sk-or-v1...d945a06b | source=env: OPENROUTER_API_KEY | models.json=sk-or-v1...d945a06b | source=models.json: ~/.openclaw/agents/main/agent/models.json
- polza effective=models.json:pza_lkxa...o8U1B9d- | models.json=pza_lkxa...o8U1B9d- | source=models.json: ~/.openclaw/agents/main/agent/models.json
- routerai effective=models.json:sk-n1B4Z...oxOOgS_y | models.json=sk-n1B4Z...oxOOgS_y | source=models.json: ~/.openclaw/agents/main/agent/models.json

OAuth/token status
- anthropic
  - anthropic:default ok expires in 0m
- openai-codex usage: 5h 41% left ⏱42m · Week 0% left ⏱5d 13h
  - openai-codex:default ok expires in 3d

Auth probes
┌──────────────────┬────────────────────────┬──────────────────────────────────────────────────────────────────────────┐
│ Model            │ Profile                │ Status                                                                   │
├──────────────────┼────────────────────────┼──────────────────────────────────────────────────────────────────────────┤
│ anthropic/       │ anthropic:default      │ auth · 19s                                                               │
│ claude-opus-4-6  │ (oauth)                │ ↳ OAuth token refresh failed for anthropic: Failed to refresh OAuth      │
│                  │                        │ token for anthropic. Please try again or re-authenticate.                │
└──────────────────┴────────────────────────┴──────────────────────────────────────────────────────────────────────────┘
Probed 1 target in 19.4s

credentials snapshot (masked)

expires_in_min= 450.28
access_prefix= sk-ant-oat01-Tfn4C
refresh_prefix= sk-ant-ort01-veHin

auth profile paths

  • /root/.openclaw/agents/main/agent/auth-profiles.json
  • /root/.openclaw/auth-profiles.json

Mitigation used

  • Temporarily fallback to openai-codex/gpt-5.3-codex
  • Re-auth via claude login
  • Resync anthropic:default OAuth fields into OpenClaw auth profiles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions