Skip to content
Source
Sign inSign up
pingdotgg/t3code

delegate_task children have no timeout, token budget or compaction cap, so a looping child drains quota unattended #36982

Closedcoreylubo(GitHub profile, opens in a new tab) opened this issue 1 comment

Note

Claude Opus 5.5 filing on behalf of coreylubo

What happened

A parent thread started five delegate_task review children on Codex. All five got stuck in an auto-compaction loop inside a single turn; the cause was the catalog-refresh 401 in issue 33701. The parent waited on them with no limit, and nothing stopped them or reported a problem. They ran for up to about 23 hours. After the weekly reset they made about 6,900 requests (about 2.0B input tokens), which used up most of the account's weekly Codex limit.

Request

Bound delegated children so that one bad child cannot drain a quota without anyone noticing. Any of the following would have contained this:

  1. Wall-clock timeout per child turn, set in delegate_task options with a sane default. When it expires, the child is interrupted and the parent gets a failed result.
  2. Token or request budget per child: cumulative input tokens or model requests. The child stops when it exceeds the budget.
  3. Compaction cap per turn: N auto-compactions within one turn (for example 10) means the turn cannot make progress. Abort it, and report it to the parent as a failure rather than as "still running".
  4. Surfacing: a child stopped by any of these shows up in the parent thread and in the UI as an error, so the user sees it even when the parent is idle.

Option 3 alone would have stopped this incident within minutes. Each child's first request already overflowed the window, and compactions came every 25 to 50 seconds.

Workaround in use

A local watchdog, run every 2 minutes from launchd, scans ~/.codex/sessions rollouts. It sends SIGTERM to any app-server whose current turn shows 15 or more compactions or 120 or more requests within 30 minutes.

Version

T3 Code (Beta) 0.1.9, managed Codex app-server 0.167.0, macOS 27.2 arm64.

  1. tanstack-source added labelsbug

  2. Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

  3. juliusmarminge closed this

Sign in to join this conversation.