Skip to content

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

Open

Description

@eengert

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-sol at low reasoning;
  • multiple hidden gpt-5.6-terra, gpt-6-luna, and codex-auto-review inference 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 = true

User-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:

  1. Memory generation/consolidation should not silently consume a large share of the interactive 5-hour quota.
  2. Background memory work should have a strict quota/cost budget and should not fan out into additional agents without a bounded cap.
  3. If background memory inference is charged against the user's plan, Desktop should visibly show that work and its quota impact.
  4. The default memory pipeline should not start expensive consolidation solely because a normal foreground thread was created.
  5. 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 = true

The 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

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    subagentIssues involving subagents or multi-agent features
    rate-limitsIssues related to rate limits, quotas, and token usage reporting
    on Oct 5, 2026
  2. eengert commented on Oct 5, 2026

    @eengert
    Author

    Controlled A/B follow-up: disabling memory generation eliminated the runaway background workload

    I performed an immediate controlled follow-up after applying the workaround:

    [memories]
    generate_memories = false
    use_memories = true

    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:

    generate_memories = false
    use_memories = true
    

    New run

    Foreground/user task:

    17:13:50  gpt-6.1-sol / low starts
    17:14:49  foreground task finishes
    

    Observed background activity during and after the task:

    gpt-6.1-sol:
      one foreground/user turn
      max observed sampling usage: 73,115
    
    gpt-6-luna:
      one ~3-second title-generation turn
      max observed sampling usage: 17,841
    
    gpt-5.6-terra:
      NONE
    
    memory generation/consolidation:
      NONE
    
    ~/.codex/memories activity:
      NONE
    
    codex-auto-review sampling:
      NONE
    

    I continued observing after the foreground task had completed. Through at least 17:16:07, there was still:

    • no Terra inference;
    • no memory stage-1 extraction;
    • no memory consolidation;
    • no memory workspace activity;
    • no delayed Auto Review sampling.

    Quota result

    Persisted Codex usage history showed:

    before controlled run: 17% used / 83% remaining
    after controlled run:  19% used / 81% remaining
    

    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

    BEFORE
    generate_memories = default (true)
    one short Sol task
    → hidden Terra memory workers
    → hidden memory-consolidation agent
    → hidden Terra subagent
    → Luna metadata jobs
    → Auto Review turns
    → ~15% of 5-hour allowance consumed
    
    AFTER
    generate_memories = false
    use_memories = true
    one short Sol task
    → Sol foreground turn
    → one tiny Luna title-generation turn
    → no Terra/memory workload
    → ~2% of 5-hour allowance consumed
    

    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.

  3. wadofmeat commented on Oct 7, 2026

    @wadofmeat

    Adding a Windows reproduction from October 7, 2026 that appears consistent with this issue.

    Environment / observed behavior:

    • Product: Codex in the ChatGPT desktop app on Windows
    • ChatGPT-authenticated workspace
    • Foreground model: GPT-6 Luna (not Astra / highest-frontier model)
    • User reports one normal Codex prompt this morning exhausted the active 5-hour Codex usage window
    • No intentional use of Astra/highest-frontier model during the run
    • The user had recently enabled local_thread_store_compression = true, but that appears to be local zstd rollout-file compression and should not itself invoke model inference
    • The config did not intentionally enable a special memory workload; this may therefore have been using the default memory behavior described in the original report

    This 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:

    [memories]
    generate_memories = false
    use_memories = true

    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.

  4. rebroad commented on Oct 8, 2026

    @rebroad

    Fixed in rebroad/codex commit 12bf4eab8d: memory consolidation now disables Feature::MultiAgentV2 and sets agents_enabled = false, alongside the existing legacy Feature::Collab disable. This prevents the consolidation worker from being given collaboration tools (including spawn_agent), avoiding failed spawns and recursive fan-out.

  5. Silver-Acid commented on Oct 14, 2026

    @Silver-Acid

    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:

    1. Persistent global activity indicator — a subtle animated icon in the app's title/status area whenever background inference is running, including after the foreground task ends. It should distinguish foreground activity from background activity.
    2. Expandable task details — clicking the indicator shows each active/recent task's purpose (e.g. memory extraction, memory consolidation, auto-review), model, status, elapsed time, and parent task/subagent relationship. A useful lifecycle would be queued / running / completed / failed / cancelled.
    3. Usage attribution — show foreground vs. background usage, and the tokens or estimated quota impact per task, plus recent history. If exact per-task quota attribution isn't available, label it as an estimate rather than implying precision.
    4. User controls and budgets — a discoverable way to pause/stop background generation, adjust memory generation separately from memory use, and enforce a background usage limit or remaining-quota threshold without editing config.toml.
    5. Abnormal-activity visibility — surface when background work continues significantly after the visible task completes or fans out into additional agents, rather than letting quota silently decrease.

    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.

  6. CipherGreyLabs commented on Oct 16, 2026

    @CipherGreyLabs

    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_provider points 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 for gpt-5.6-terra at effort medium — and all of them carried the same conversation id, distinct from the foreground thread's id:

    01:34:54  gpt-5.6-terra  medium  thread <consolidation>  7718 ms  200
    01:35:02  gpt-5.6-terra  medium  thread <consolidation>  7698 ms  200
    01:35:10  gpt-5.6-terra  medium  thread <consolidation>  3999 ms  200
    

    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-luna at effort low:

    01:40:19  gpt-5.6-luna  low  thread <foreground>  14872 ms  200
    01:40:19  gpt-5.6-luna  low  thread <foreground>  12945 ms  200
    

    Correlation with <CODEX_HOME>/memories

    The memory files were rewritten in the same minute as the Terra burst:

    <CODEX_HOME>/memories/MEMORY.md           250,979 B   rewritten 01:34
    <CODEX_HOME>/memories/memory_summary.md     65,960 B   rewritten 01:34
    <CODEX_HOME>/memories/raw_memories.md      297,958 B   rewritten 01:30
    

    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 for gpt-5.6-luna at low, and a consolidation phase asking for gpt-5.6-terra at medium.

    Multi-month trend (the part that is hard to see per-incident)

    Aggregated from the same proxy log. Mean durationMs per request, so this is a workload proxy rather than a token count:

    month gpt-5.6-terra runs mean gpt-5.6-luna calls mean
    2026-07 93 10,944 ms 1,379 12,193 ms
    2026-08 1,371 12,986 ms 25,017 12,266 ms
    2026-09 1,197 13,604 ms 36,885 11,613 ms
    2026-10 573 16,060 ms 149 28,720 ms

    Per-run work is rising steadily (Terra +47% July → October), on a roughly stable ~20–75 Terra runs per day. The October luna row 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.

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

    appIssues related to the Codex desktop appbugSomething isn't workingmemoryrate-limitsIssues related to rate limits, quotas, and token usage reportingsubagentIssues involving subagents or multi-agent features

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions