Subagent fan-out can increase usage because each agent pays fixed context/tool/skill overhead

Open 💬 7 comments Opened Aug 20, 2026 by ChrisMasterton
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

Multi-agent workflows can unintentionally consume more Codex usage than a single-agent workflow, even when subagents use smaller models.

The likely reason is the fixed per-agent context cost. Every spawned subagent is a new model context and may need to carry or reconstruct some combination of:

  • system/developer/Codex instructions
  • AGENTS.md / repo instructions
  • available tool schemas
  • skill catalogue / skill metadata
  • environment/repository context and discovery
  • delegated task instructions
  • parent thread history when context is forked
  • its own subsequent tool results and reasoning history

With several small subagents, that fixed cost is multiplied. A workflow intended to save usage by delegating small tasks to cheaper models can therefore backfire if each child only performs a small amount of useful work.

For example, splitting one investigation into five agents for manifest, permissions, upstream bug research, tests, and platform behavior may require all five agents to load substantially the same baseline universe before doing relatively little unique work.

Prompt caching may reduce compute/cost internally, but from a user perspective the Codex allowance can still appear to drain dramatically faster under aggressive subagent fan-out. This creates a bad optimization trap: users are encouraged to use smaller specialized agents to conserve usage, but the orchestration pattern may consume more of their allowance than one larger agent doing the work serially.

Requested improvements

  1. Show per-agent usage in the UI, including parent and each subagent.
  2. Break usage down into cached input, uncached input, output/reasoning, and ideally fixed/bootstrap context.
  3. Show whether a child inherited/forked parent context and approximately how much context that added.
  4. Warn when spawning many agents is likely to cost more than keeping the work in the current thread.
  5. Consider making lightweight/isolated subagents truly lightweight: minimal tool schemas, only explicitly relevant skills, and no parent history unless required.
  6. Consider an orchestration heuristic that groups tiny related tasks into one subagent instead of fanning them out.

A UI like this would make the behavior obvious:

Parent              84k
├─ android-agent    31k
├─ tests-agent      27k
├─ research-agent   34k
└─ review-agent     29k

Total              205k
Cached input        ...
Allowance charged  ...

Why this matters

Without visibility into the fixed cost of a subagent, spawning one feels nearly free. Architecturally it is not. This makes it very easy for users to accidentally burn through a weekly Codex allowance much faster while believing they are optimizing usage.

Related issues exist around subagent model/usage visibility and token breakdown, but the specific concern here is the multiplication of fixed context overhead caused by subagent fan-out and the resulting incentive mismatch.

View original on GitHub ↗

7 Comments

github-actions[bot] contributor · 7 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #39469
  • #38519
  • #38989

Powered by Codex Action

ChrisMasterton · 7 days ago

This is why you are getting codex-limit drains.

ChrisMasterton · 7 days ago

Additional anecdotal data point from the reporter: after disabling the broad plugin/skill setup and turning off the recent multi-agent-heavy workflow, Codex usage dropped to roughly 1% over ~4 hours of continued use.

Before that change, usage had been draining much faster under a configuration with every suggested plugin enabled, ~53 skills, and frequent agent fan-out.

This is not a controlled benchmark and does not isolate which component is responsible, but it is a strong enough before/after signal that it may be worth instrumenting specifically. In particular, it would be useful to compare:

  • single-agent vs multi-agent runs on the same repo/task
  • minimal vs large skill catalogs
  • minimal vs broad plugin/tool-schema sets
  • forked vs isolated subagent context
  • cached vs uncached input and actual allowance accounting

The concern is not only user quota consumption: if repeated subagents are each processing large baseline contexts/tool schemas/skill metadata for small delegated tasks, there may also be unnecessary backend inference/GPU cost despite prompt caching.

The biggest product issue is that users are being encouraged to enable skills/plugins and use agents as an efficiency pattern, while the current UI provides no way to see whether that configuration is actually more expensive than a simpler single-agent setup.

urays · 7 days ago

In version 0.148.0, the context window sizes for the main thread and sub-threads could be configured separately. However, why was this reasonable and excellent design removed in version 0.149.0? This forces the entire sub-thread to be enabled if I want to open a larger context window, such as 1,000,000. Is this to make users pay more for OpenAI?

ChrisMasterton · 6 days ago

@urays I think this may be an important clue and could explain why the behavior suddenly became so noticeable.

One distinction worth making: a 1,000,000-token context window does not itself mean every sub-agent consumes 1,000,000 tokens. The window is capacity, not necessarily actual input size.

However, if the change from 0.148.0 → 0.149.0 removed the ability to configure a smaller context window for sub-threads independently of the main thread, that could absolutely be the trigger for the regression we're observing.

The mechanism I'm concerned about is this:

  • Before, a smaller sub-thread context limit may have forced child agents to receive a reduced/compacted context.
  • With sub-threads now sharing the much larger context configuration, substantially more parent history / repo context / tool and skill context may fit without compaction.
  • Each spawned agent is still a separate invocation with its own context.
  • Fan-out then multiplies that larger baseline across N agents.

So the two observations may fit together rather than conflict:

The 1M-context/configuration change may be the trigger; sub-agent context multiplication is the cost mechanism.

For example, if a parent has accumulated 100k–200k of effective context, previously a constrained child may have received a compacted subset. If the child can now accept the whole thing, spawning 5–10 agents can suddenly become dramatically more expensive even though none of them is anywhere near the full 1M limit.

This would also explain why the regression could appear suddenly around a version/configuration change even though multi-agent support itself already existed.

It would be extremely useful if the Codex team could instrument/confirm across 0.148.0 and 0.149.0:

  • actual input tokens supplied to each child agent
  • cached input tokens vs uncached input
  • inherited/forked context size per child
  • whether/when context compaction occurs before spawning a child
  • whether the configured 1M context size changes those compaction/inheritance decisions
  • allowance charged per child invocation

Right now we can only infer this from the usage meter, but @urays' version-specific observation gives a very concrete place to investigate.

urays · 6 days ago

@ChrisMasterton Actually, I think the context window, whether it's the original default 272K, the current 1M, or 512K, isn't the problem. The key is how to intelligently determine when to compress.

Unfortunately, I haven't seen a mature approach on Codex or other agent harnesses... However, if the Codex team does it, it would be a truly groundbreaking breakthrough.

ChrisMasterton · 6 days ago

Agreed that by itself isn’t a problem, it’s the compounding effect of more
context and tokens being introduced, easily and without transparency.

Potentially (again, compounded by) a lack of prompt caching on new agents,
new /side-chats (?).

To me that explains why we see such different patterns with some draining
limits in hours and others seemingly not affected. If you work for OAI you
have infinite tokens so you are literally not going to see the issue unless
you have tests in place to count token in/out on the same repeated tasks.

On Fri, Aug 21, 2026 at 7:04 AM urays @.***> wrote:

urays left a comment (openai/codex#39808) <https://github.com/openai/codex/issues/39808#issuecomment-5370854881> @ChrisMasterton <https://github.com/ChrisMasterton> Actually, I think the context window, whether it's the original default 272K, the current 1M, or 512K, isn't the problem. The key is how to intelligently determine when to compress. Unfortunately, I haven't seen a mature approach on Codex or other agent harnesses ... However, if the Codex team does it, it would be a truly groundbreaking breakthrough. — Reply to this email directly, view it on GitHub <https://github.com/openai/codex/issues/39808?email_source=notifications&email_token=ABYF3KCJDX6MPDYU3BEBAZL5LBJIJA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMZXGA4DKNBYHAY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5370854881>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABYF3KHSEWNAODMFCAWY6JL5LBJIJAVCNFSNUABFKJSXA33TNF2G64TZHM4TMNJUGE2TMNBZHNEXG43VMU5TKMRQHA3DONBSGQY2C5QC> . You are receiving this because you were mentioned.Message ID: @.***>