openai / openai/codex

Codex CLI repeatedly wakes xhigh to poll deterministic long-running jobs, exhausting finite weekly usage before task completion

Open
#45,974 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI model-behavior rate-limits
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of Codex CLI is running?

0.154.0

What subscription do you have?

Pro-Light

Which model were you using?

Astra-xhigh

What platform is your computer?

Darwin 25.6.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Apple Terminal (Terminal.app)

Codex doctor report
{
  "schemaVersion": 1,
  "generatedAt": "1789575158s since unix epoch",
  "overallStatus": "ok",
  "codexVersion": "0.154.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/Users/joshmcclure/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/Users/joshmcclure/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/Users/joshmcclure/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/Users/joshmcclure/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/Users/joshmcclure/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "/Users/joshmcclure/.codex/auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/Users/joshmcclure/.codex",
        "active thread overrides": "not inspected",
        "config.toml": "/Users/joshmcclure/.codex/config.toml",
        "config.toml parse": "ok",
        "configuration load ms": "3",
        "configuration scope": "invocation config, including cloud-managed policy",
        "cwd": "/Users/joshmcclure",
        "enabled feature flags": "shell_tool, view_image, sleep_tool, unified_exec, unified_exec_tty, unified_exec_zsh_fork, shell_snapshot, content_item_kinds, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, unbounded_connection_retries, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, in_app_chat, in_app_dictation, in_app_local_automation, in_app_updates, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, item_ids, skill_mcp_dependency_install, skill_search, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, compaction_image_budget, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "48",
        "log dir": "/Users/joshmcclure/.codex/log",
        "mcp servers": "2",
        "model": "gpt-6-astra",
        "model provider": "openai",
        "sqlite home": "/Users/joshmcclure/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "desktop.app.version": {
      "id": "desktop.app.version",
      "category": "desktop",
      "status": "ok",
      "summary": "the desktop application is installed",
      "details": {
        "log directory": "$HOME/Library/Logs/com.openai.codex",
        "running": "true",
        "version": "26.908.40834"
      },
      "remediation": null,
      "durationMs": 0
    },
    "desktop.app_server.handshake": {
      "id": "desktop.app_server.handshake",
      "category": "desktop",
      "status": "ok",
      "summary": "no desktop app-server handshake was recorded",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "desktop.security.enforcement": {
      "id": "desktop.security.enforcement",
      "category": "desktop",
      "status": "ok",
      "summary": "the desktop application passed available macos security assessments",
      "details": {
        "gatekeeper": "accepted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git executable found; execution not verified",
      "details": {
        "PATH git #1": "/usr/bin/git",
        "PATH git entries": "1",
        "git execution": "not inspected (PATH helpers are not executed)",
        "repo detected": "false",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 0
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/opt/homebrew/bin/codex",
        "current executable": "/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin/codex",
        "install context": "npm (package /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin, bin /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin, resources /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-resources, path /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path)",
        "managed by Vite+": "false",
        "managed by bun": "false",
        "managed by npm": "true",
        "managed by pnpm": "false",
        "managed package root": "/opt/homebrew/lib/node_modules/@openai/codex",
        "npm update target": "not inspected (PATH helpers are not executed)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "MCP configuration is locally consistent",
      "details": {
        "configured servers": "2",
        "disabled servers": "1",
        "stdio servers": "2"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "managed proxy": "not configured",
        "proxy env vars": "none",
        "respect system proxy": "disabled",
        "system proxy": "direct"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "ChatGPT inference URL": "https://chatgpt.com/backend-api/<redacted> reachable (HTTP 405)",
        "desktop assets CDN": "https://chatgpt.com/backend-api/<redacted> reachable (HTTP 200)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 320
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 2 IPv6, first IPv6",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 674
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running npm on macos-aarch64",
      "details": {
        "commit": "unknown",
        "current executable": "/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin/codex",
        "install method": "npm (package /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin, bin /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin, resources /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-resources, path /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path)",
        "platform": "macos-aarch64",
        "version": "0.154.0"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search command found (bundled); execution not verified",
      "details": {
        "search command": "/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path/rg",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "none",
        "denied-read glob rules": "0",
        "denied-read rules": "0",
        "execve wrapper helper": "/Users/joshmcclure/.codex/tmp/arg0/codex-arg0HwgccB/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "glob scan max depth": "unbounded",
        "managed filesystem source": "none",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "security.endpoint": {
      "id": "security.endpoint",
      "category": "security",
      "status": "ok",
      "summary": "no supported endpoint protection detected",
      "details": {
        "endpoint products": "none detected"
      },
      "remediation": null,
      "durationMs": 12
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/Users/joshmcclure/.codex (dir)",
        "active rollout files": "684 files, 3336772714 total bytes, 4878322 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/Users/joshmcclure/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/Users/joshmcclure/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/Users/joshmcclure/.codex/log (dir)",
        "memories DB": "/Users/joshmcclure/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "queue DB": "/Users/joshmcclure/.codex/queue_1.sqlite (file)",
        "queue DB integrity": "ok",
        "sqlite home": "/Users/joshmcclure/.codex (dir)",
        "state DB": "/Users/joshmcclure/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok",
        "thread history DB": "/Users/joshmcclure/.codex/thread_history_1.sqlite (file)",
        "thread history DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 2816
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "ok",
      "summary": "rollout files and state DB thread inventory agree",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "684",
        "rollout DB active rows": "684",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "0",
        "rollout DB archived rows": "0",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread ids": "0",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "0",
        "rollout DB missing archived rows": "0",
        "rollout DB model providers": "openai=684",
        "rollout DB rows": "684",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "cli=526, subagent:other=110, subagent:review=36, subagent:thread_spawn=9, vscode=3",
        "rollout DB stale rows": "0"
      },
      "remediation": null,
      "durationMs": 395
    },
    "system.disk": {
      "id": "system.disk",
      "category": "disk",
      "status": "ok",
      "summary": "sufficient free disk space (13.6 GiB)",
      "details": {
        "CODEX_HOME available": "13.6 GiB",
        "failure threshold": "1.0 GiB",
        "warning threshold": "5.0 GiB",
        "worktree available": "13.6 GiB"
      },
      "remediation": null,
      "durationMs": 0
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language en-US",
      "details": {
        "EDITOR": "not set",
        "LANG": "en_US.UTF-8",
        "VISUAL": "not set",
        "os": "Mac OS 26.6.2 [64-bit]",
        "os language": "en-US",
        "os type": "Mac OS",
        "os version": "26.6.2"
      },
      "remediation": null,
      "durationMs": 2
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "COLORTERM": "truecolor",
        "TERM_PROGRAM": "Apple_Terminal",
        "color output": "enabled",
        "effective locale": "en_US.UTF-8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "Apple Terminal",
        "terminal size": "80x24",
        "terminal version": "470.2"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "cwd",
        "terminal title project value": "joshmcclure",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.154.0",
        "check for update on startup": "true",
        "last checked at": "2026-09-15T23:03:57.240967Z",
        "latest version": "0.154.0",
        "latest version status": "current version is not older",
        "npm update target": "not inspected (PATH helpers are not executed)",
        "update action": "npm install -g @openai/codex",
        "version cache": "/Users/joshmcclure/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 448
    }
  }
}
What issue are you seeing?

Codex CLI/Astra xhigh stayed in a model-mediated polling loop around long-running deterministic jobs and exhausted my main weekly Codex usage before the implementation completed.

This was one continuous WASDE data-engineering implementation session:

Uploaded thread: 01a098e5-0707-7530-9138-688b82a1e86e

Environment:

Codex CLI 0.154.0
Model: gpt-6-astra
Reasoning effort: xhigh
Fast mode off
Pro-Light

The difficult semantic work was legitimate, but once long-running parse/load/audit jobs were already running, Codex repeatedly resumed Astra/xhigh to poll progress rather than allowing the shell/process to own the wait and return only on completion or failure.

Representative late-run sequence:

2026-09-16T11:49:17.187Z
Astra: "The audited load has reached 333 reports. Both audits remain clear; no intervention is needed."

Codex then launched another status operation that waited on the live process for 60 seconds and reread progress JSON:

2026-09-16T11:49:22.228Z
exec:
await tools.write_stdin({
session_id:79012,
chars:"",
yield_time_ms:60000,
max_output_tokens:100
})

then read:
unit-and-meat-reparse-process.json
unit-and-meat-fact-diff/progress.json

It then issued another explicit wait:

2026-09-16T11:49:29.280Z
wait:
{"cell_id":"5590","yield_time_ms":60000,"max_tokens":500}

The result was only healthy incremental progress:

2026-09-16T11:50:22.319Z
status: running
expected: 688
completed: 576
errors: 0
unexpected_changes: 0
sources: 339
failures: []

Astra then summarized that status in prose and continued.

The autonomous goal context during this same period stated:

Continue working toward the active thread goal.

Budget:

  • Token budget: none
  • Tokens remaining: unbounded

No-progress check:

  • A verified wait polls a specific process, session, job, or tool handle confirmed live now.

Near the final limit hit, Codex again waited on the same kind of healthy deterministic work:

2026-09-16T11:54:09.717Z
status: running
expected: 688
completed: 595
errors: 0
unexpected_changes: 0
sources: 354
failures: []

Immediately afterward the session terminated:

{
"timestamp": "2026-09-16T11:54:10.143Z",
"type": "event_msg",
"payload": {
"type": "task_complete",
"error": {
"message": "You've hit your usage limit. Visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at Sep 22nd, 2026 1:06 PM.",
"codex_error_info": "usage_limit_exceeded"
}
}
}

Support has clarified that the nearby codex_bengalfox used_percent: 0.0 event refers to a separate Spark meter, not the exhausted main weekly Codex limit, so I am not reporting that meter as the bug.

The issue I am reporting is the execution behavior: xhigh remained in the loop to repeatedly poll deterministic background jobs even after Astra itself stated that no intervention was needed.

I had also repeatedly warned Astra earlier in the same retained session that inference usage was becoming a critical constraint and asked why it had not changed course.

Expected behavior:

For long-running deterministic work, Codex should launch the job, suspend model inference, and resume only when the process exits, fails, or emits an event requiring judgment. A shell-side waiter such as:

while kill -0 "$PID" 2>/dev/null; do
sleep 30
done
tail -n 25 "$LOG"

should not require repeated Astra/xhigh turns.

The complete uploaded session contains thousands of exec/tool interactions, including repeated wait/status loops. I have preserved the full rollout JSONL and can provide additional excerpts if useful.

What steps can reproduce the bug?

Uploaded thread: 01a098e5-0707-7530-9138-688b82a1e86e

What is the expected behavior?

Codex should treat long-running deterministic work as machine-owned execution, not as a reason to keep invoking the reasoning model.

Once Astra has made the necessary engineering decision and launched a parser, loader, verifier, database job, or other deterministic process, the expected behavior is:

Launch the job.
Allow the shell/process to block, wait, or monitor it without repeated model inference.
Suspend Astra/xhigh while no judgment is required.
Resume the model only when:
the process completes successfully;
the process fails;
an exception or unexpected state requires model judgment; or
the user intervenes.
Return terminal output, a structured receipt, failure bundle, or relevant log tail to the model when it resumes.

For example, this should be sufficient:

while kill -0 "$PID" 2>/dev/null; do
sleep 30
done

tail -n 25 "$LOG"

During the sleep loop, there should be no repeated Astra/xhigh turns merely to observe that the process is still running.

A persistent autonomous goal should also distinguish between:

reasoning progress — new information requiring model judgment; and
machine progress — a deterministic job continuing normally.

Machine progress should not require repeated model wakeups to count as progress.

If a long-running task materially changes in scope, expected duration, convergence risk, or resource consumption, Codex should surface an owner checkpoint rather than silently continuing the same execution strategy.

In short, the expected model is:

xhigh reasons
→ launches deterministic work
→ model goes dormant
→ machine finishes or fails
→ xhigh resumes on the result

rather than:

xhigh checks status
→ waits 60 seconds
→ xhigh checks status
→ waits 60 seconds
→ repeat

This is especially important when the user is operating under a finite weekly Codex usage limit.

Additional information

This occurred during a genuinely difficult multi-day data-engineering implementation, and Astra did substantial useful work. I am not reporting that xhigh was inherently too expensive or that the task should have been easy.

The issue is that the execution strategy did not scale down model involvement when the work became mechanical.

The affected main rollout contains approximately:

5,593 exec calls
230 explicit waits
67 context compactions
thousands of small diagnostic/tool interactions

Near the end, Astra had already determined the semantic corrections, frozen the relevant code path, identified the affected population, and launched deterministic reparse/load/audit jobs. At that point the machines owned the work. Nonetheless, Codex continued waking Astra/xhigh to monitor incremental progress.

I had also repeatedly told Astra earlier in the same retained session that Codex usage had become a critical constraint and asked why it had not changed course. Those warnings remained present in later compacted context, but the execution policy did not materially change.

There were also few natural owner waypoints. When the project materially changed in scope, duration, or convergence risk, Astra generally adapted internally and continued rather than pausing to surface:

what assumption had failed,
what had changed,
whether another expensive corpus cycle was justified,
what machine work versus model work remained, and
whether owner direction was needed.

I believe there are two related product issues worth examining:

Long-running deterministic jobs need an event-driven/blocking wait path that does not repeatedly invoke the model.
Persistent autonomous goals need better resource/convergence governance, including owner checkpoints when the task materially changes or becomes machine-bound.

The full session has already been uploaded through Codex CLI feedback:

Uploaded thread: 01a098e5-0707-7530-9138-688b82a1e86e

I also have the complete local rollout JSONL and a detailed postmortem if additional evidence is useful.

I have a separate OpenAI Support case handling the account-side usage review, so this GitHub issue is intended to document the engineering behavior rather than request account remediation here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The payload identifies Codex CLI 0.154.0 as the entry point but names no source file or test. Reproduce a deterministic long-running job with Astra-xhigh on Pro-Light, then trace the polling and wake behavior; done means polling no longer repeatedly consumes finite weekly usage before the job completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ai, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.