-
-
Notifications
You must be signed in to change notification settings - Fork 69.2k
[Bug]: openai-codex OAuth succeeds in browser but OpenClaw ends with TypeError: fetch failed and auth_permanent #43057
Description
Bug type
Behavior bug (incorrect output/state without crash)
Summary
On OpenClaw 2026.3.8 (3caab92) with Node 22.22.0 on macOS, I’m using openai-codex/gpt-5.4 with openai-codex OAuth.
Running:
openclaw models auth login --provider openai-codex
opens the browser auth flow successfully. The browser finishes with:
Authentication successful. Return to your terminal to continue.
But the terminal then shows:
OpenAI OAuth failed
TypeError: fetch failed
After that, agent execution fails with:
Provider openai-codex has auth_permanent issue (skipping all models) (auth_permanent)
What I checked:
-
gateway is installed/running
-
browser localhost callback succeeds
-
no proxy env vars
-
curl to auth.openai.com and api.openai.com works
-
Node fetch to https://api.openai.com also works
This looks like a failure in OpenClaw’s post-callback OAuth handling for openai-codex, not a general network issue.
Is this a known issue, and is there a workaround?
Steps to reproduce
as before
Expected behavior
as before
Actual behavior
as before
OpenClaw version
as before
Operating system
as before
Install method
No response
Model
as before
Provider / routing chain
as before
Config file / key location
No response
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response