Repository navigation
Parallel subagents cause extreme token amplification and repeated compaction #33196
Description
Summary
On 2026-07-14 between 20:39 and 21:00 (Asia/Shanghai), Codex consumed an unexpectedly large amount of tokens while working on a music_score task.
The task was to analyze how newly added artist-statistics fields should be connected to the data lake and application code.
Observed behavior
A parent session spawned two parallel review subagents:
- Parent: 019f5688-69ed-7663-98ab-605632b5687c
- 019f60a3-c2f2-7961-b739-5ed05eadc087 — standards_review
- 019f60a3-e3ba-7202-afde-e8d88c3d89dc — spec_review
The two subagents started within seconds of each other and showed nearly identical behavior:
- Approximately 340M cumulative tokens per subagent within about two minutes
- More than 2,200 token-count events per subagent
- 10 context compactions per subagent
- 486 patch-apply events per subagent
- Repeated context processing despite the task being a bounded review
The aggregate cumulative token count across active sessions reached approximately 1.4B.
Environment
- Codex Desktop on macOS
- Subagent CLI: 0.144.2
- Parent session CLI: 0.144.0-alpha.4
- OpenAI model provider
- Reported subagent context window: 353,400 tokens
Expected behavior
Parallel subagents should consume tokens roughly in proportion to the actual work performed. Context compaction and patch application should not enter a replay or retry loop.
Actual behavior
Two parallel subagents appear to have repeatedly reprocessed or replayed the same large context. Their event counts and token growth were almost identical, suggesting duplicated context processing or a compaction/retry loop.
Related issues
- Codex Desktop: remote-compaction capacity error terminalizes one persistent goal while other tasks remain healthy #33171 — remote-compaction failure in long-running tasks and subagents
- Large-context Codex Desktop tasks can remain silent for 9–32 minutes at model response boundaries #33024 — large-context tasks becoming silent at model response boundaries
- Subagent feature: Launching concurrent subagents instantly drains entire Pro plan usage quota #9748 — concurrent subagents unexpectedly draining usage quota
- Context compaction regression in CLI v0.118 — 2x more frequent compactions cause token usage explosion #16812 — compaction regression causing token usage amplification
Questions
- Is parent context duplicated when multiple review subagents are spawned?
- Why are thousands of token-count events emitted within minutes?
- Can repeated compaction or patch application enter a replay loop?
- Is this related to the mixed CLI versions 0.144.0-alpha.4 and 0.144.2?
Activity
github-actions commentedon Jul 15, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
lunaynx commentedon Jul 19, 2026
Are you using ultra mode? There's currently a bug (or "feature") with Codex where it will spawn every single subagent with ultra as well.
cansitki commentedon Jul 21, 2026
One measurement caveat may matter here: a child rollout JSONL contains a large replayed prefix of the parent/shared history at spawn. Counting every token_count or compacted event in each child file, then summing child files, therefore double-counts the same cumulative telemetry.
I audited 59 direct child rollouts from one long-lived multi-agent thread. Separating the replayed prefix from child-specific events gave:
Two representative rollouts contained 4,078 / 64 replayed events before 12 / 0 child-specific events, and 244 / 4 before 15 / 0, respectively (token_count / compacted).
This means the reported 1.4B aggregate should not be interpreted as independent new token usage, or as billing-equivalent usage, without deduplicating the shared history. This does not remove the underlying amplification problem: subagents inherit the parent model/reasoning setting (related: #32587), can start with very large contexts, and long-lived children genuinely produce many additional turns and compactions. But the thousands-of-events-in-two-minutes portion appears to be mostly rollout-history replay, not thousands of fresh model calls.
I can provide a sanitized classification script if it would help.
92645417d9e5c763259dbebc306e3e commentedon Aug 18, 2026
Additional evidence for #33196
Environment
rust-v0.148.0-alpha.1.gpt-5.6-sol, Ultra reasoning, Multi-Agent V2 enabled.Observed impact
last_token_usage.total_tokenswas108,247while the reported model context window was828,400.272,000, that baseline consumes about 40% immediately and leaves only about 164K tokens for new work. Repeated compactions make the thread practically unusable.Decisive evidence
AgentMessageitems with 177,928 bytes of encrypted payload.Reproduction
send_messageorfollowup_task.token_countdata and replacement-history type/size counts; raw prompts, identifiers, and encrypted payloads are not required.Expected behavior
Additional context
kosza123 commentedon Aug 25, 2026
Hi @ctykwz — I’m doing independent research on whether a vendor-neutral “no progress” watchdog could detect multi-agent replay/compaction loops before they amplify token use. Your parent + two nearly identical subagent sessions are a particularly valuable case.
Would you be willing to share a metadata-only export from those three sessions: timestamps, parent/child session role, event type, tool name, hashes of canonicalized arguments,
context_compactedmarkers, cumulative token counters, patch-event counts, and stop/end time?Please do not post raw transcripts, prompts, paths, file contents, patches, tool outputs, or secrets. If you’re open to it, just reply here; I can provide a minimal schema and redaction steps first. This is independent research, not OpenAI support or a product request.
Thanks — Filip