Stack Gems
Menu
← Log

2026-10-10

"Done" in Codex means the turn ended, not the spending

OpenAI Codex issue #52382: a turn reported task_complete seven seconds after launching a batch that went on to finish 15 more codex exec requests (~556k tokens) over 17 minutes and exhaust the five-hour window.

Codex Desktop marks the task complete, and a batch script it started keeps calling the Codex CLI on your account for another 17 minutes. OpenAI Codex issue #52382 logs that sequence. The turn emitted `task_complete` seven seconds after launching a Python batch. The batch then completed 15 more `codex exec` requests, about 556k tokens, before hitting `usage_limit` and exhausting the five-hour window. Those figures come from one reporter’s own session logs for a single incident, not from a rerun.

The Codex source explains why: background processes are deliberately kept alive past the turn, and are only reaped at session shutdown or when a client explicitly asks to clean background terminals. At turn end, Codex counts the live background terminals, but that number goes to a telemetry metric. The completion event the app renders has no field for it. So "completed" means the model stopped talking, not that the work it launched stopped spending.

When an agent starts anything that can call a model, give that work a budget and a process group you can kill, and check for live background terminals before you walk away. Done describes the turn, not the processes it left running.

Subscribe: /log/feed.xml