#Agent failed before reply: OAuth token refresh failed for openai-codex: Failed to refresh OAuth toke

1 messages Β· Page 1 of 1 (latest)

ivory barnBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

night joltBOT
#

That error means your Gateway tried to use OpenAI Codex (ChatGPT OAuth) (openai-codex) and the refresh token got rejected, so the agent can’t get a valid access token β†’ it fails before it can reply.

Most common fix is just re-auth the openai-codex provider, then restart the gateway.

1) First: what version are you on?

Please paste:

openclaw --version

2) Re-login to Codex OAuth (on the SAME machine/user that runs the Gateway)

openclaw models auth login --provider openai-codex
openclaw gateway restart
openclaw models status