Repository navigation
Codex Desktop 26.930.31730: default memory generation fans out into hidden agents and consumes ~15% of 5-hour quota after a 2-minute task #51177
Description
Summary
A tightly bounded ~2-minute foreground task in Codex Desktop triggered a much larger hidden background workload from the default memory system. The user-visible 5-hour quota went from about 98% remaining to 83% remaining over only a few minutes, and continued dropping after the foreground task had finished.
Local telemetry captured the incident while it was happening. It shows:
- exactly one visible/user thread using
gpt-6.1-solat low reasoning; - multiple hidden
gpt-5.6-terra,gpt-6-luna, andcodex-auto-reviewinference threads started at the same time; - the Terra threads were memory-generation/consolidation work under
~/.codex/memories; - one memory thread spawned a hidden Terra subagent;
- the hidden work continued for several minutes after the foreground Sol task completed;
- server rate-limit headers climbed during the hidden activity.
This appears to be a current regression/continuation of the class of problems reported in #19732, #22008, #36806, and #40110, but this report has a tightly correlated foreground-task trigger, default memory configuration, hidden fan-out, token telemetry, and server-side quota headers from a current Desktop build.
Environment
- Product: Codex Desktop for macOS
- Incident Desktop client version from app-server telemetry:
26.930.31730 - Auth: ChatGPT
- Plan reported by server headers:
team - Foreground model:
gpt-6.1-sol - Foreground reasoning effort:
low - Platform: macOS
- Memory config before incident: no
[memories]section at all in~/.codex/config.toml
Therefore the effective memory behavior came from Codex defaults. Current source defaults include:
generate_memories = true
use_memories = true
After the incident, the user applied this workaround and restarted/updated Desktop:
[memories]
generate_memories = false
use_memories = trueUser-visible quota timeline
Immediately before the test, the user observed about 98% remaining in the 5-hour window.
A single tightly bounded task was submitted. It ran for roughly two minutes.
Observed remaining quota:
before task: ~98%
after foreground task: ~89%
a few minutes later: ~84% (official Codex usage page)
1-2 minutes later: ~83% (official Codex usage page)
The continued drop after the visible task ended was what prompted immediate telemetry capture.
CodexBar history later recorded 17% used / 83% remaining, matching the official page observation.
Local telemetry timeline
Visible/user task
16:46:36 gpt-6.1-sol / low starts
16:48:44 visible Sol task finishes
thread_source=user
originator=Codex Desktop
This is the only normal persisted user thread from the incident.
Hidden inference launched alongside it
At essentially the same time, Desktop started multiple non-user threads with real sampling (websocket.warmup=false, run_sampling_request, output items, and token-usage updates):
16:46:36-16:46:39 gpt-6-luna / low
automatic task-title generation
16:46:36-16:50:06 gpt-5.6-terra / medium
hidden memory work
16:46:37-16:52:49 gpt-5.6-terra / medium
hidden memory consolidation under ~/.codex/memories
16:46:49-16:50:21 gpt-5.6-terra / high
hidden subagent spawned by the memory-consolidation thread
16:46:58-16:47:01 gpt-6-luna
automatic thread-description/summary generation
16:47:03-16:47:40 codex-auto-review
3 separate reviewer turns
The hidden Terra/Luna threads had no normal durable user-thread rows or rollout history corresponding to visible chats.
Memory-system evidence
One hidden Terra prompt begins:
Consolidate the supplied rollout summaries into memory_summary.md so another
agent understands the user, finds relevant prior work, and continues correctly.
Another hidden Terra job was operating in:
~/.codex/memories
and was given the memory workspace instructions involving memory_summary.md, MEMORY.md, and raw_memories.md.
That memory job then called spawn_agent and created another hidden Terra subagent.
The subagent completion telemetry alone reported:
model: gpt-5.6-terra
reasoning effort: high
input_tokens: 380,812
cached_input_tokens: 320,256
non_cached_input_tokens: 60,556
output_tokens: 7,080
reasoning_output_tokens: 4,368
total_tokens: 387,892
This was background memory work, not the foreground user task.
Across the incident, the local logs contain many repeated post sampling token usage observations for the hidden memory threads. The hidden work continued until about 16:52:49, more than four minutes after the visible Sol task ended.
Server-side quota correlation
Responses from the hidden codex-auto-review activity carried real Codex rate-limit headers:
16:47:05 x-codex-primary-used-percent: 5
16:47:16 x-codex-primary-used-percent: 7
16:47:35 x-codex-primary-used-percent: 8
So the 5-hour bucket was measurably increasing while the hidden workload was running. These are server response headers, not a local UI estimate.
By the end of the episode, the official usage page showed 17% used / 83% remaining.
Why this seems wrong
The user explicitly requested one small, bounded Sol/Low task. Codex silently launched a much larger background memory workload, including memory consolidation and a subagent, and that work consumed the same 5-hour allowance.
The memory feature was not explicitly enabled or tuned by the user; there was no [memories] section in config.toml. It was running because generation is enabled by default.
A user should not be able to lose ~15 percentage points of a 5-hour allowance from a two-minute task without any visible indication that several background agents are running.
Expected behavior
At minimum, one or more of the following seems necessary:
- Memory generation/consolidation should not silently consume a large share of the interactive 5-hour quota.
- Background memory work should have a strict quota/cost budget and should not fan out into additional agents without a bounded cap.
- If background memory inference is charged against the user's plan, Desktop should visibly show that work and its quota impact.
- The default memory pipeline should not start expensive consolidation solely because a normal foreground thread was created.
- Memory generation should stop promptly as quota consumption rises rather than continuing for minutes after the foreground task completes.
Workaround
Disabling generation while retaining memory use:
[memories]
generate_memories = false
use_memories = trueThe user has applied this mitigation and restarted/updated Codex Desktop. A controlled follow-up run will be performed to verify whether the hidden Terra memory fan-out disappears.
Related
- Codex Desktop idle usage drain from background memory generation; stopped after generate_memories=false #19732 — idle usage drain from background memory generation; stopped with
generate_memories=false - Hidden memory_consolidation subagent consumed 5-hour Pro quota after Stop hook failure #22008 — hidden
memory_consolidationsubagent consuming 5-hour quota - Memory generation: no per-transcript size cap causes context-window failures, and defaults run quota down to 25% #36806 — memory generation size/cost controls and quota depletion
- Codex background memory worker runaway — bug and quota restoration request #40110 — background memory worker runaway
Activity
eengert commentedon Oct 5, 2026
Controlled A/B follow-up: disabling memory generation eliminated the runaway background workload
I performed an immediate controlled follow-up after applying the workaround:
Then I updated/restarted Codex Desktop, archived the prior test thread, and started a brand-new Sol-6.1 / Low thread for another tightly bounded task.
Verification before the test
The restarted app had loaded:
New run
Foreground/user task:
Observed background activity during and after the task:
I continued observing after the foreground task had completed. Through at least 17:16:07, there was still:
Quota result
Persisted Codex usage history showed:
So this comparable fresh-thread test consumed approximately 2 percentage points, versus approximately 15 percentage points in the prior run with default memory generation enabled.
Before/after comparison
This is a strong A/B indication that the runaway consumption in the original incident was caused primarily by background memory generation/consolidation, not by the foreground Sol task itself.
The workaround also preserves existing memory usage via
use_memories = true, so it appears possible to retain memory context while preventing the expensive background generation pipeline.wadofmeat commentedon Oct 7, 2026
Adding a Windows reproduction from October 7, 2026 that appears consistent with this issue.
Environment / observed behavior:
local_thread_store_compression = true, but that appears to be local zstd rollout-file compression and should not itself invoke model inferenceThis is notable because the visible workload/model choice does not appear proportionate to exhausting an entire 5-hour allowance.
The user is preserving the remaining reset(s) rather than repeatedly reproducing the problem. We are also disabling background memory generation as a mitigation while keeping memory reads enabled:
It would be useful if OpenAI can confirm whether server-side logs for affected Windows/Desktop sessions show hidden memory-generation / memory-consolidation / subagent work charging the primary 5-hour bucket, or whether there is also a broader quota-accounting regression.
If maintainers need additional diagnostic fields (Desktop/Codex build number, local telemetry paths, timestamps, or before/after usage screenshots), I can provide those from the affected machine.
rebroad commentedon Oct 8, 2026
Fixed in rebroad/codex commit 12bf4eab8d: memory consolidation now disables
Feature::MultiAgentV2and setsagents_enabled = false, alongside the existing legacyFeature::Collabdisable. This prevents the consolidation worker from being given collaboration tools (includingspawn_agent), avoiding failed spawns and recursive fan-out.Silver-Acid commentedon Oct 14, 2026
I'd like to add a UI/UX request alongside the quota and memory-worker safeguards discussed here: Codex Desktop needs a unified, visible indicator for background model activity, not just a memory-specific warning.
At the moment, the foreground task can appear finished or idle while memory consolidation, metadata generation, auto-review, or spawned background agents continue making model calls. If those calls use the user's allowance, the UI should make that visible.
A practical design could include:
config.toml.This does not require showing private chain-of-thought or internal prompts: task metadata and resource consumption are enough.
The central issue is observability and user control. Even if the excessive Terra fan-out is fixed, users should be able to tell what Codex is doing in the background, why it is running, and whether it is consuming their interactive quota.
CipherGreyLabs commentedon Oct 16, 2026
Second environment, same signature — with proxy-side per-request telemetry
Adding an independent confirmation from Windows 11 x64 on Codex CLI/Desktop
0.162.0-alpha.17.2, ChatGPT auth, memory behaviour left at defaults (generate_memories = true,use_memories = true; no[memories]override at the time of these observations).The useful difference from the report above: this machine runs Codex behind a local OpenAI-compatible proxy (
model_providerpoints at a loopback Responses endpoint). Every inference request Codex makes is therefore logged with provider, model, requested effort, conversation id, duration and HTTP status. Hidden threads stop being hidden.What the proxy log shows while only one foreground thread is active
While a single foreground thread ran on
gpt-6.1-sol, the proxy logged concurrent requests forgpt-5.6-terraat effortmedium— and all of them carried the same conversation id, distinct from the foreground thread's id:Three multi-second inference runs inside 16 seconds, on a model nobody selected.
A separate 4-minute window with exactly one foreground thread running on a non-OpenAI model still produced two hidden
gpt-5.6-lunaat effortlow:Correlation with
<CODEX_HOME>/memoriesThe memory files were rewritten in the same minute as the Terra burst:
This matches the finding above that the Terra threads are memory-generation/consolidation work under
~/.codex/memories, and matches the documented pipeline shape: an extract phase asking forgpt-5.6-lunaatlow, and a consolidation phase asking forgpt-5.6-terraatmedium.Multi-month trend (the part that is hard to see per-incident)
Aggregated from the same proxy log. Mean
durationMsper request, so this is a workload proxy rather than a token count:gpt-5.6-terrarunsgpt-5.6-lunacallsPer-run work is rising steadily (Terra +47% July → October), on a roughly stable ~20–75 Terra runs per day. The October
lunarow is also interesting: volume collapsed while mean duration more than doubled, which is what you would expect if the cheap per-turn helper traffic stopped and the remaining calls are the longer extract work.One controlled measurement, and its limit
With the client idle for 10 minutes and no foreground turns, the proxy log gained zero new requests and the account's 5-hour and weekly meters were unchanged. So idle alone does not drain anything here — the consumption tracks foreground work, which is consistent with this issue's trigger.
Not measured: I could not capture a successful turn on a second client transport I have configured, because those turns currently fail before completion on this machine. I therefore make no claim about that path. I also cannot determine from the client side what exactly schedules the consolidation runs; the volume (~20–75/day) does not correlate with new-session count (0–8/day here), so something other than session completion is driving the cadence.
Context worth adding
This installation deliberately uses persistent worker chat threads with context handoff between chats rather than Codex subagents, and some of those threads are very large (one rollout file is 183 MB; single turns carry ~820k input tokens). That may simply amplify what this issue reports — flagging it because the meta tracker mentions client-side workflow amplification.
Workaround status
The workaround already posted here (
[memories] generate_memories = false,use_memories = true) was applied and reverted on this machine during unrelated testing, so I have no full-day before/after to contribute for it.Related tracker: #41220.