Published March 2026
I hit this exact failure recently:
Agent failed before reply: OAuth token refresh failed for openai-codex: Failed to refresh OAuth token for openai-codex. Please try again or re-authenticate. Logs: openclaw logs --follow
The short version is: your OpenClaw runtime is fine, but the OAuth session for openai-codex is stale or invalid and needs to be re-authenticated.
Run this command:
openclaw onboard --auth-choice openai-codex
That re-runs onboarding and refreshes auth for the OpenAI Codex provider. I got this exact recovery path from a YouTube walkthrough and confirmed it works in practice.
openclaw status and verify model/auth look normal.openclaw logs --followopenclaw gateway restartThe key lesson: this error usually looks scary but is mostly an auth refresh issue, not a full system failure. Re-auth, verify, and move on.