Skip to content

[BUG] Luna xhigh multi-agent audit: 5h quota jumped 22% → 98% in 117 seconds (~4.42M input tokens) #58898

Open

Description

@maksymturskyi-del

Summary

During a single Codex CLI task that was still in read-only audit/research, the account's 5-hour usage meter rose from 22% to 98% in approximately 117 seconds, and the weekly meter from 62% to 74%. The task did not produce the requested feature or modify the project's network routing before hitting the usage limit. The CLI spawned two research subagents, and locally recorded token counts show repeated very large input contexts.

This is a request to investigate context propagation / repeated context processing, subagent budget control, caching, and quota accounting. Local counters establish heavy token processing but do not by themselves prove a billing error.

Environment

  • Date: 2026-11-02
  • Codex CLI version: 0.164.0 (reported in the environment)
  • Model setting: Luna, xhigh reasoning (user-facing selection; exact model identifier not independently verified)
  • Single task: Android/Kotlin launcher integration for Avast VPN and USB-tethered Linux client; instructed to perform read-only audit and request approval before changes that could disrupt networking
  • Parent session started two research subtasks (presented as launcher_audit and vpn_arch_research); exact child-session mapping and fork_context configuration not yet verified

Observed meter movement (UTC)

Timestamp 5h quota used Weekly quota used
14:13:39 22% 62%
14:13:52 41% 65%
14:14:18 52% 67%
14:14:52 76% 70%
14:15:36 98% 74%

All timestamps are from local Codex rollout-*.jsonl event_msg/token_count records; the displayed percentages are the primary.used_percent and secondary.used_percent reported by Codex.

Token counters during this period

Taking cumulative token counters once per session (not summing repeated snapshots):

Session Input tokens Output tokens
Parent session, increment from 14:13:35 to 14:15:40 1,104,603 11,486
New child session A, final cumulative 569,693 704
New child session B, final cumulative 2,746,142 3,347
Total 4,420,438 15,537

The larger child starts with ~186,549 input tokens on its first reported request and repeatedly adds roughly 195k–228k input tokens per subsequent request, reaching 2.75M cumulative input tokens while emitting just 3.3k output tokens. The parent session was continuing concurrently.

The pasted metric extract does not include the cached_input_tokens breakdown; cached vs uncached usage, exact server-side quota weights, and whether context was forked must be checked from original session data / telemetry.

Expected behavior

  • A read-only task should not unexpectedly exhaust most of the 5h window before producing an implementation or a useful audit deliverable.
  • Spawned subagents should not inherit or repeatedly reprocess unnecessarily huge contexts without clear budget visibility / an effective shared usage guard.
  • Usage meters should be explainable from request and cache-accounting records.

Actual behavior

  • UI repeatedly warned of low remaining 5h quota during simple source inspection and shell/ADB read-only commands.
  • In the final ~2 minutes, the 5h meter rose by 76 percentage points, weekly by 12 points.
  • Task stopped at usage-limit error before the requested implementation; no risky live routing test was started.

Questions for maintainers

  1. Was the ~180k+ token initial context for a fresh subagent expected? Was fork_context / fork_turns active?
  2. Were repeated 200k+-token inputs cached, and if so how did cache usage affect the reported quota?
  3. Are parent/child session limits aggregated correctly and is there a shared hard-stop/budget?
  4. Is this a known regression in 0.164.0 or the selected model configuration?

Potentially related: #55997 (5h allowance exhausted in 11 minutes), #56672 (5h exhausted in ~4m21s), #55180 (shared spending budget across agents).

Privacy

This report intentionally omits private project paths, raw ADB dumps, tokens, IP/MAC addresses, and full local rollout files. Sanitized per-request counts and subagent spawn parameters can be provided through an appropriate private support channel if required.

Activity

  1. added
    bug
    CLI
    subagent
    rate-limits
    context
    on Nov 2, 2026
  2. Zyph3rKeaton commented on Nov 2, 2026

    @Zyph3rKeaton

    The large child's first request is the best place to investigate: record its spawn options, inherited-history size and per-request cached-input breakdown, alongside the parent's activity at the same timestamps. For a bounded comparison, rerun one small audit with a single agent and an explicit file list, stopping at one concrete finding. Keep acceptance criteria identical and count each session's cumulative usage once; that tests context propagation without interpreting the quota jump as proof of overbilling.

  3. maksymturskyi-del commented on Nov 2, 2026

    @maksymturskyi-del
    Author

    Follow-up: per-request cached-input breakdown from existing local JSONL (no additional model run)

    Thanks for the suggestion. I extracted payload.info.last_token_usage from the original token_count events for 2026-11-02 14:13:39–14:15:40 UTC. Duplicated terminal events were excluded. This is local usage telemetry, not a server-side billing audit.

    Session Requests counted Input tokens Cached input Non-cached input Output tokens Cached share
    Parent (increment in this interval) 6 1,104,603 1,080,832 23,771 11,486 97.85%
    New child A 3 569,693 380,416 189,277 704 66.78%
    New child B 13 2,746,142 2,527,488 218,654 3,347 92.04%
    Total 22 4,420,438 3,988,736 431,702 15,537 90.23%

    Critical observation: huge first requests by new children

    • Child A first request (14:13:39.215 UTC): 182,122 input tokens, only 6,912 cached (175,210 non-cached), 127 output.
    • Child B first request (14:13:47.147 UTC): 186,549 input tokens, only 6,912 cached (179,637 non-cached), 84 output.
    • Thus, the two initial child requests alone contributed 354,847 non-cached input tokens (~82.2% of all non-cached input in this 117-second interval).
    • Parent was simultaneously using ~174k–197k input tokens per request, mostly cached.
    • Child B's subsequent inputs were typically ~195k–227k per request with a high cached share.

    The near-equal 182k/186k first-request sizes, overlapping with the parent's large context, strongly motivate inspecting the two spawn_agent events and inherited histories, but do not alone prove fork_context was enabled or determine what text was inherited.

    In parallel, the five-hour usage meter went from 22% to 98% and the weekly meter from 62% to 74%, as already reported. 90.23% of input tokens were cache hits; this does not determine whether the quota accounting was incorrect, because quota weights and server-side accounting remain unknown.

    Request: Please investigate the launch settings for the two child sessions, why they each started with >180k input tokens, how cached vs non-cached tokens affect quota at these timestamps, and whether a shared budget can limit amplification. Original spawn_agent payloads and full rollouts were not included in the pasted metric extract. I can provide sanitized spawn parameters and request-level statistics; I prefer not to rerun a potentially expensive multi-agent test until we understand this incident.

  4. maksymturskyi-del commented on Nov 2, 2026

    @maksymturskyi-del
    Author

    Forensic follow-up from the existing rollouts

    The launches map directly to the child files: launcher_audit (agent_type=explore) was spawned at 14:13:27.422Z and ran as gpt-6-luna/low; vpn_arch_research (agent_type=researcher) was spawned at 14:13:35.073Z and ran as gpt-6-astra/high. Their first recorded requests were 14:13:39.022Z and 14:13:45.073Z; their task-complete events were 14:13:52.643Z and 14:15:36.875Z. The parent was gpt-6-luna/xhigh. Each spawn call records only task_name, agent_type, and message; it does not record explicit model/reasoning or fork_context/fork_turns arguments. Child metadata confirms the parent relationship (forked_from_id/parent_thread_id) and records history_mode=paginated. All three session metadata records say CLI 0.166.0, differing from the reported 0.164.0.

    The child transcripts contain substantial parent history: 234/248 response-item IDs in A and 236/281 in B match the parent, including 52 inherited tool-call/output pairs in each. No compaction marker appears. This makes copied conversation/tool history a strong explanation for the >180k first-request contexts, although local usage records cannot isolate tokens attributable to inherited history versus agent instructions/task text.

    Accounting scope clarification: unique per-response usage records from 14:13:39.022Z through 14:15:35.934Z total 4,223,675 input tokens over 21 responses (3,800,320 cached; 423,355 uncached; 13,251 output; 8,980 reasoning). The previously reported 4,420,438/22-response total includes an additional parent response at 14:15:40.308Z (196,763 input), after the final 98% meter sample at 14:15:36.870Z. The broader total is reproducible from local telemetry, but it is not strictly the chart's ~117-second window. These local records do not establish server-side quota treatment or a billing error.

  5. Zyph3rKeaton commented on Nov 3, 2026

    @Zyph3rKeaton

    The inherited item IDs and corrected time window make this much easier to investigate. Keep two explicitly labelled totals: the 21 responses ending before the final meter sample, and the broader 22-response interval; attach the child model/effort mapping to each. A compact table of first-request size, inherited item count and cache split per child should give maintainers the main launch signature from your existing evidence, without another paid run. Server-side quota attribution remains a separate question.

  6. liu2995502189 commented on Nov 5, 2026

    @liu2995502189

    从11月4号下午五点半开始,额度消耗突然加快。11月5日早上重新执行一次小修改并验收的任务,9点57分开始执行,10点15分发现才刷新的五小时额度全部用光,且任务没执行完。
    使用模型6.1terra,标准速度,推理强度:高。

  7. liu2995502189 commented on Nov 5, 2026

    @liu2995502189

    8. 从11月4号下午五点半开始,最高消耗突然加速。11月5日早上重新执行一次小并验收的任务,9点57分开始执行,10点15分才发现刷新的五小时全部用光,且没执行完。
    使用模型6.1terra,标准速度,推理强度:高。

    查了下本地json日志,原来是6.1terra的的输入缓存一直在膨胀,膨胀到一个任务就把五小时额度用光了都不触发自动压缩。

  8. Zyph3rKeaton commented on Nov 5, 2026

    @Zyph3rKeaton

    @liu2995502189 One useful check in the JSONL you already have is whether the growing cache figure is a cumulative session total or the last response’s usage; adding cumulative snapshots repeatedly would overcount consumption. Keep one row per unique completed response, with its input, cached input, output, and any compaction event. That gives maintainers a usable sequence alongside the quota timestamps, without spending another limit reproducing it; cache growth alone does not explain the quota debit.

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

    CLIbugcontextrate-limitssubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions