Skip to content

[Bug]: Fallback chain not triggered on 429 quota errors for openai-codex provider #24102

@derricksy

Description

@derricksy

Summary

When an agent hits a 429 "You exceeded your current quota" error from the openai-codex provider, the configured model fallback chain does not trigger. The agent retries the same model repeatedly and fails permanently instead of falling back to the next model in the chain.

Steps to reproduce

  1. Configure an agent in agents.list with model.primary=openai-codex/gpt-5.2-codex and model.fallbacks=[kimi-coding/k2p5, minimax-portal/MiniMax-M2.5]
  2. Each agent has its own auth-profiles.json with a single openai-codex:default token
  3. Exhaust the Codex token quota (or use a token that has hit its limit)
  4. Trigger the agent via sessions_spawn from another agent
  5. Observe: agent retries openai-codex 4 times with stopReason=error, never attempts fallback models

Expected behavior

429 quota error should be classified as failover-eligible (same as "usage limit" errors per #687), triggering the configured model.fallbacks chain. Agent should fall back to kimi-coding/k2p5, then minimax-portal/MiniMax-M2.5.

Actual behavior

stopReason: error returned 4 times with the same provider (openai-codex) and model (gpt-5.2-codex). Fallback models (kimi-coding/k2p5, minimax-portal/MiniMax-M2.5) are never attempted. Session ends with permanent failure.

Error message: "429 You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors."

OpenClaw version

2026.2.17

Operating system

macOS 14.x

Install method

npm global

Logs, screenshots, and evidence

Impact and severity

Affected: Any agent using openai-codex as primary model with fallbacks configured
Severity: High — agent permanently fails instead of degrading gracefully
Frequency: 100% repro when Codex token quota is exhausted
Consequence: Fallback models are never used, defeating the purpose of the fallback chain config. Workaround is token isolation across separate rate limit pools, but fallback should still work

Additional information

Possibly related to #11972, #19249, #5744. The fix in #687 ("recognize usage limit errors as rate limits for failover") appears to not cover the openai-codex provider's specific 429 quota error message: "You exceeded your current quota, please check your plan and billing details."

Agent config:
{
"model": {
"primary": "openai-codex/gpt-5.2-codex",
"fallbacks": ["kimi-coding/k2p5", "minimax-portal/MiniMax-M2.5"]
}
}

Per-agent auth via ~/.openclaw/agents//agent/auth-profiles.json (no global auth.order for openai-codex).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions