Skip to content

Runaway inline image duplication during context compaction creates 20+ GB rollout files #37346

Open

Description

@krosman19

What version of Codex CLI is running?

0.146.1

What subscription do you have?

Pro

Which model were you using?

No response

What platform is your computer?

No response

What terminal emulator and version are you using (if applicable)?

No response

Codex doctor report

What issue are you seeing?

Corroborating this issue with an independent occurrence on Codex CLI 0.146.1, macOS 26.6, Apple Silicon.

Two dormant rollout files were found:

  • 21,047,403,972 bytes with only 6,194 JSONL records

    • 37,593 occurrences each of input_image, image_url, data:image, and base64
    • 443 context compactions
  • 7,697,818,808 bytes with only 2,943 JSONL records

    • 12,600 occurrences each of those image markers
    • 125 context compactions

Both files are fully allocated rather than sparse and have been dormant since July 23–24, 2026. codex doctor reports 17 OK, 0 warnings, and 0 failures, and the rollout/state-database inventories reconcile cleanly.

This independently confirms the same on-disk image amplification across two threads and shows that it persists in Codex CLI 0.146.1. No rollout files, logs, screenshots, thread IDs, or private conversation data are attached.

A supported repair path that removes duplicated binary payloads while preserving the text transcript would be valuable.

What steps can reproduce the bug?

Uploaded thread: 019fd86f-346c-7f23-88dd-68caa8bdb497

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    contextIssues related to context management (including compaction)
    on Aug 7, 2026
  2. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor
  3. krosman19 commented on Aug 7, 2026

    @krosman19
    Author

    Related to #34863, which tracks the same compaction/image-amplification mechanism primarily through Desktop and app-server symptoms. This report adds an independent Codex CLI 0.146.1 occurrence involving dormant 21.0 GB and 7.7 GB rollouts. Please consolidate or close as a duplicate if both cases share the same fix.

  4. robinhur commented on Sep 7, 2026

    @robinhur

    Still reproducing on Codex CLI 0.153.2 (the report above was on 0.146.1), macOS 26.6, Apple Silicon. Adding a measurement that pins the amplification law exactly: growth is linear in compaction count, at one full copy of the image set per compaction.

    Single-thread breakdown (678 MB rollout, 319 JSONL records)

    • 44 records exceed 1 MB, and every one of them is a compacted record carrying replacement_history
    • each of those 44 records is 15.2 MB and contains exactly 30 input_image entries — identical size, identical count, record after record
    • data:image/png occurrences: 1,320 = 30 unique images × 44 compactions
    • unique image payload ≈ 30 × 526 KB ≈ 15.4 MB; file is 678 MB → 97.7 % duplication
    • input_image count outside compaction records: 0 — the images exist only inside replacement_history, i.e. this thread never captured them; it inherited the history and re-serialized it on every compaction

    The slope is stable across threads on the same host

    compactions rollout size MB per compaction
    44 678 MB 15.41
    51 786 MB 15.41
    57 878 MB 15.40
    62 971 MB 15.66
    64 1,010 MB 15.78
    242 4,356 MB 18.00

    15.4 MB/compaction matches the unique image-set size almost exactly, which is what makes "one full copy per compaction" the mechanism rather than an estimate.

    Host-wide impact

    No rollout contents, thread IDs, screenshots, prompts, or conversation data are attached — counts and sizes only.

    A fix that makes replacement_history reference prior image records instead of re-embedding them (or that drops image payloads from compaction snapshots entirely) would remove essentially all of this. A supported repair path for existing rollouts — stripping duplicated binary payloads while preserving the text transcript — would also help, since these files cannot safely be deleted wholesale while their threads may still resume.

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

    CLIIssues related to the Codex CLIbugSomething isn't workingcontextIssues related to context management (including compaction)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions