Skip to content

Session forking writes full parent rollout into child JSONL (storage amplification despite forked_from_id) #35647

Description

@Yasei-no-otoko

What version

  • openai/codex (desktop + CLI)

Severity

P1 - local disk growth and resumability risk from persistent thread fork storage amplification

What is happening

A newly forked/branched thread can still persist a full parent-history payload instead of only fork-local delta when forked_from_id exists, producing large duplicated .jsonl rollouts and rapidly exhausting disk.

Observed local reproduction matches the following parent/thread IDs:

  • Parent thread: 019e1823-6e48-75f0-a644-c8c043cef937
  • Child thread: 019f9ff6-d5eb-7292-9446-add44e4024b2
  • Child thread: 019fa108-23a7-7921-ab39-0092e1227f2d

These files are in ~/.codex/sessions/2026/07/27/ and are still showing duplicated large inherited content characteristics unless rewritten, and they are expected to be reduced to local-only delta with a parent cutoff (history_base).

Expected behavior

  • Child thread rollouts must not materialize parent history inline when a fork boundary exists.
  • Child rollouts should store the minimum delta after a valid forked_from_id / boundary offset.
  • Legacy readers must remain compatible, with explicit history_base metadata for managed children.

Why this is urgent

  • Existing local report already shows large local growth and high-pressure behavior in ~/.codex/sessions.
  • Parent-child duplication can silently multiply costs for long sessions and repeated forking.
  • It also increases startup/replay and context-reconstruction cost.

Related context

I have a local patch-set with hardening around:

  • managed child validation at read/list/fork paths
  • path/rollout lock scoping fixes to avoid resume deadlock
  • reference child rejection for malformed / external rows
  • fork/reference history cutoff handling in thread-store and rollout_lineage

Related issues already discussed:

  • 22593 (Session forks duplicate parent history on disk)
  • 34337 (CLI + Desktop session rollouts consume huge disk)
  • 34268 (forks duplicate compaction snapshots)

Please triage as urgent because this is a repeatable storage amplification class and affects both CLI/Desktop shared persistence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIappIssues related to the Codex desktop appbugSomething isn't workingperformancesessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions