Skip to content

Cron jobs fail with 'Failed to extract accountId from token' when falling back to OpenAI Codex provider #36604

@laulopezreal

Description

@laulopezreal

Bug Description

Cron jobs that fall back to openai-codex/gpt-5.3-codex (when the primary Anthropic provider is rate-limited or in cooldown) fail with:

Failed to extract accountId from token

The error occurs before the LLM runs — the job summary is just the error message itself, meaning no actual work gets done.

Steps to Reproduce

  1. Configure model fallback chain: anthropic/claude-sonnet-4-6openai-codex/gpt-5.3-codex
  2. Trigger enough requests to put Anthropic in cooldown
  3. Cron job fires, gateway selects Codex as fallback
  4. Job fails with Failed to extract accountId from token

Evidence

  • 11 total occurrences across multiple cron jobs over ~1 week
  • 100% correlated with gpt-5.3-codex model selection — zero failures on Anthropic models
  • Affected jobs: chess-daily, violeta-0915-smart, lili-free-time, violeta-dm-open-targets, and others
  • deliveryStatus shows delivered in some cases (delivery works), but the job itself produces no output

Expected Behavior

The Codex provider should extract accountId from the gateway token the same way other providers do, or handle it gracefully.

Workaround

Pin critical cron jobs to anthropic/claude-sonnet-4-6 with --model override to avoid Codex fallback.

Environment

  • OpenClaw: 2026.2.26 (config written by 2026.3.2)
  • Node.js: v25.6.1
  • OS: Ubuntu 24.04 LTS
  • Gateway: running on Hetzner dedicated server via Tailscale

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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