Repository navigation
Description
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_auditandvpn_arch_research); exact child-session mapping andfork_contextconfiguration 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
- Was the ~180k+ token initial context for a fresh subagent expected? Was
fork_context/fork_turnsactive? - Were repeated 200k+-token inputs cached, and if so how did cache usage affect the reported quota?
- Are parent/child session limits aggregated correctly and is there a shared hard-stop/budget?
- 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
github-actions commentedon Nov 2, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Zyph3rKeaton commentedon Nov 2, 2026
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.
maksymturskyi-del commentedon Nov 2, 2026
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_usagefrom the originaltoken_countevents 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.Critical observation: huge first requests by new children
The near-equal 182k/186k first-request sizes, overlapping with the parent's large context, strongly motivate inspecting the two
spawn_agentevents and inherited histories, but do not alone provefork_contextwas 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_agentpayloads 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.maksymturskyi-del commentedon Nov 2, 2026
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 asgpt-6-luna/low;vpn_arch_research(agent_type=researcher) was spawned at 14:13:35.073Z and ran asgpt-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 wasgpt-6-luna/xhigh. Each spawn call records onlytask_name,agent_type, andmessage; it does not record explicit model/reasoning orfork_context/fork_turnsarguments. Child metadata confirms the parent relationship (forked_from_id/parent_thread_id) and recordshistory_mode=paginated. All three session metadata records say CLI0.166.0, differing from the reported0.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.
Zyph3rKeaton commentedon Nov 3, 2026
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.
liu2995502189 commentedon Nov 5, 2026
从11月4号下午五点半开始,额度消耗突然加快。11月5日早上重新执行一次小修改并验收的任务,9点57分开始执行,10点15分发现才刷新的五小时额度全部用光,且任务没执行完。
使用模型6.1terra,标准速度,推理强度:高。
liu2995502189 commentedon Nov 5, 2026
查了下本地json日志,原来是6.1terra的的输入缓存一直在膨胀,膨胀到一个任务就把五小时额度用光了都不触发自动压缩。
Zyph3rKeaton commentedon Nov 5, 2026
@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.