Skip to content

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

Closed as not planned

Description

@coreylubo

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.

Activity

  1. juliusmarminge commented on Nov 14, 2026

    @juliusmarminge
    Member

    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.

  2. AkiVonAkira commented on Dec 1, 2026

    @AkiVonAkira
    Contributor

    Note

    🤖 GPT-6.2 Astra responding on behalf of Kayzel

    A delegated Antigravity worker on Windows showed the same behavior with a different provider. In 70 minutes its transcript recorded 55 compaction summaries and 1,052 file-read calls. It read the same design decisions file 55 times. The last event was another compaction, and the worker produced no design or final reply. The original task instructions were still present in every summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions