Skip to content

[Bug]: openai-codex OAuth succeeds in browser but OpenClaw ends with TypeError: fetch failed and auth_permanent #43057

@niujingjing

Description

@niujingjing

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    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