Skip to content

[Bug]: openai-codex OAuth succeeds on macOS, but all Codex requests fall back to Gemini #39035

@fangjing2021

Description

@fangjing2021

Bug type

Regression (worked before, now fails)

Summary

Summary

On macOS, OpenClaw can complete openai-codex OAuth successfully and enumerate Codex models, but actual requests to Codex models never complete. The agent always falls back to Gemini.

Environment

  • OpenClaw: 2026.3.7 (GitHub source build)
  • macOS (Apple Silicon)
  • Proxy: Clash 127.0.0.1:7897
  • OpenAI Codex OAuth login succeeds
  • Official codex CLI works with the same account and proxy

Steps to reproduce

  1. Install OpenClaw from GitHub source so active version is 2026.3.7
  2. Set proxy env:
    • HTTP_PROXY=http://127.0.0.1:7897
    • HTTPS_PROXY=http://127.0.0.1:7897
    • ALL_PROXY=http://127.0.0.1:7897
    • NO_PROXY=127.0.0.1,localhost
  3. Run:
    • openclaw models auth login --provider openai-codex
  4. Complete browser OAuth successfully
  5. Set main model to one of:
    • openai-codex/gpt-5.1-codex-mini
    • openai-codex/gpt-5.3-codex
    • openai-codex/gpt-5.4
  6. Restart gateway
  7. Run:
    • openclaw agent --agent main --message 'ping' --json

Expected behavior

OpenClaw should answer using the configured openai-codex/* model.

Actual behavior

OpenClaw starts with the Codex model configured, but the request does not complete through Codex. The final reply always comes from:

  • google-gemini-cli/gemini-3-flash-preview

Evidence

  • OAuth succeeds:
    • Auth profile: openai-codex:default (openai-codex/oauth)
  • Codex models enumerate correctly:
    • openai-codex/gpt-5.1-codex-mini
    • openai-codex/gpt-5.3-codex
    • openai-codex/gpt-5.4
  • Gateway confirms configured model:
    • agent model: openai-codex/gpt-5.4
  • But actual agent response metadata shows:
    • provider: google-gemini-cli
    • model: gemini-3-flash-preview

OpenClaw version

2026.3.7

Operating system

macos 14.5

Install method

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 workingregressionBehavior that previously worked and now failsstaleMarked as stale due to inactivity

    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