Home/ Incident database/codex-9h-compaction-loop-2026-08
Financial loss Runaway loop verified

OpenAI Codex stuck in a 9-hour compaction loop drained an entire weekly usage allowance

Codex user (OpenAI Developer Community) · Aug 25, 2026 · Coding agent

What happened

A user asked Codex to make a relatively small change to an existing project. Instead of completing it, the agent entered a continuously repeating loop: it announced the changes it was going to make, ran context compaction, re-explained the same plan, compacted again, and re-started - sometimes pulling previously completed work back into the workflow. The loop ran for roughly 9 hours unattended and took the account's weekly usage from 100% to 0% while the original task remained incomplete. The reporter asked for loop detection, no-progress timeouts, and a warning when a single task consumes an unusual share of usage.

Loss / impact
Aug 25
2026
Runaway
Failure mode
Coding
Agent type

Causal vector

Context-compaction loop: state lost across repeated compactions, same steps re-planned and re-executed for hours with no repetition guard or spend ceiling

Source

Reported by OpenAI Developer Community (first-hand report). Verified against the primary report.

Read the original report ↗

How a spend firewall would have helped

A loop that re-plans the same completed work for nine hours is detectable at the call level: identical-intent requests with no state change are a repetition signature, and a firewall that blocks after N duplicate-intent actions preserves the rest of the week's budget instead of consuming all of it.

The six rule types that contain this class of failure

Per-transaction cap

Any single spend above your ceiling is BLOCKED before it moves.

Daily total

Cumulative spend across all agent calls, bounded per day.

Velocity limit

Stops runaway retry loops — the #1 cause of overnight losses.

Merchant allowlist

Only approved destinations can ever receive funds.

Category rules

Flag high-risk classes (crypto, infra, refunds) for review.

Approval threshold

Above a value, the action waits for a human.

Related incidents

Don't be the next entry

Every incident in this database is the result of trusting a prompt, a provider cap, or a human review cycle. sipi.bot replaces all three with one deterministic call. 71 documented failures, one control.