Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.903.61454
What subscription do you have?
Pro
What platform is your computer?
Darwin 25.6.0 arm64 arm
What issue are you seeing?
Environment
- Codex desktop (ChatGPT.app)
26.903.61454(build 8378), macOS26.6.1, Apple Silicon - Session
cli_versionrecorded in rollout:0.144.0-alpha.4 - Long-running remote-control session, hosted on a Mac mini, accessed from iPhone / another Mac
Summary
Context compaction rewrote the session's rollout .jsonl in place, replacing the durable
transcript with a compacted summary. The file went from 851,046,757 bytes / 122,877 records
to 7,117,868 bytes / 762 records. All 3,777 assistant messages were discarded. Only the
584 user messages survived, embedded in a replacement_history array inside a single
compacted record, alongside one encrypted_content compaction entry.
Because the app renders thread history from the rollout, the entire visible conversation
disappeared from every client simultaneously (Mac mini, MacBook, iPhone). The session itself kept
running and kept responding.
Compaction should bound what the model carries in context. It should not be destructive to the
stored record. Here the working context and the durable transcript are the same file, so trimming
one destroyed the other.
Impact
- Two months of conversation (2026-07-11 → 2026-09-09) became unrenderable and unrecoverable
from the live installation. - Loss is silent. No warning before, no error after. The thread still lists and still accepts
messages; it just shows nothing. - Recovery was only possible because an APFS local Time Machine snapshot happened to exist from
12 minutes before the rewrite.
Timeline (local time)
| Time | Event |
|---|---|
| 2026-07-11 15:27:42 | Session starts. Rollout created. |
| ~2 months | Normal use. 175 compacted records accumulate; the file retains full history throughout. |
| 2026-09-09 17:59:21 | Rollout file recreated (birth timestamp), 851 MB → 7.1 MB. Assistant turns discarded. |
| 2026-09-09 18:50:50 | legacy_to_paginated_v1 migration runs against the now-truncated file. |
| 2026-09-09 18:54 | User notices blank history on all three clients. |
Note the filename still encodes the original July start time
(rollout-2026-07-11T15-27-42-<thread-id>.jsonl) while the inode's birth time is the compaction
moment. Records at the head of the rewritten file carry July timestamps but contain September
message IDs, which is what makes the rewrite visible.
Reproduction
Not deliberately reproduced — this was a production session. Conditions present:
- Very long-lived thread (2 months, ~3.07 billion cumulative tokens reported in
token_count). - Multi-agent use — the thread spawned ~170 sub-agent threads.
- Always-loaded remote-control session (auto-resumed via
startup_prewarmon every app-server start). - Context compaction triggered on a rollout of ~851 MB.
Secondary bug: migration silently skips the compacted rollout
The rewritten rollout carries a ContextCompaction item plus world_state and
token_usage_record record types. legacy_to_paginated_v1:
- flipped
threads.history_modetopaginated, - wrote
thread_history_projection_statewith the cursor parked at EOF
(next_rollout_byte_offset= file size), so no backfill can ever occur, - projected zero items,
- recorded no row in
rollout_migration_skipped_rollouts.
Every other thread on the machine (2,000+) migrated correctly. Re-running the sweep will not
revisit this thread, because history_mode is already paginated.
Third issue: always-loaded threads never read stored history
For a thread that is loaded, thread/resume takes resume_running_thread and composes the
response from the in-memory session, which starts empty on each load. It never consults
thread_items. Combined with startup_prewarm auto-loading this session at app-server startup,
the stored-history path is unreachable for this thread — repopulating thread_items correctly
had no effect on what the client displayed.
Relevant log line, repeating on every open:
resume_running_thread: thread/resume overrides ignored for loaded thread <id>:
config overrides were provided and ignored while running
Also observed
The desktop client requests experimental feature keys the bundled app-server rejects as invalid,
including one directly related to this area:
ignoring invalid experimental feature enablement keys:
apps_mcp_path_override, background_paginated_rollout_migration, local_thread_store_compression
Expected behavior
- Compaction must not mutate or truncate the stored rollout. Bound the model's context window
without destroying the durable record — separate files, or append a compaction marker while
retaining prior records. - If a destructive rewrite is genuinely intended, retain the pre-compaction file and warn.
- A migration that projects zero items must record a skip with a reason rather than marking the
thread migrated. - A loaded thread should fall back to stored history when its in-memory item list is empty.
Artifacts available
- Pre-compaction rollout, 851,046,757 bytes, recovered from an APFS snapshot (SHA-256 available).
- Post-compaction rollout, 7,117,868 bytes.
- App-server logs covering the migration and every resume.
What steps can reproduce the bug?
Use the app. Watch your thread get destroyed.
What is the expected behavior?
No response
Additional information
No response
Activity
github-actions commentedon Sep 10, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
noclascio commentedon Sep 10, 2026
Related to #44033 but not a duplicate — and the difference matters for which subsystem is at fault.
#44033 (Windows) shows the same end state: long-running threads whose JSONL shrank drastically
(267 MB → 5.26 MB, 710 MB → 3.63 MB), zero rows in
thread_turns/thread_items, projectionstate at EOF,
legacy_to_paginated_v1marker present. That matches this report on macOS, so thedefect is cross-platform.
Two differences worth keeping separate:
1. Severity of the data loss. In #44033 the stored JSONL still contains user and assistant
messages. In my case only user messages survived — the
compactedrecord'sreplacement_historyholds 584 entries, every one
role: "user", and all 3,777 assistant turns are gone from disk.Same mechanism, worse outcome.
2. What actually did the rewriting. #44033 documents the shrunken files and empty tables and
asks whether it's a migration defect. The timestamps here say it isn't:
after the session started, while the filename still encodes the original
2026-07-11T15-27-42start.legacy_to_paginated_v1completed at 18:50:50 — 51 minutes later, against an alreadytruncated file.
So the migration is a downstream victim, not the cause. It then compounds the problem by flipping
threads.history_modetopaginatedand writingthread_history_projection_statewith the cursoralready at EOF, projecting zero items and recording no row in
rollout_migration_skipped_rollouts— which means re-running the sweep never revisits the thread.
If these are consolidated, the fix needs to land on compaction's write path rather than on the
migration.
lufu159 commentedon Sep 13, 2026
I can confirm what appears to be the same destructive-compaction issue on Windows.
Environment
OpenAI.Codex_26.908.4834.0_x64codex-cli:0.154.0-alpha.6.2Windows evidence
Two long-running tasks remained visible and could still accept new messages, but most of their earlier assistant replies disappeared.
replacement_history, but only 27 top-level assistant messages.replacement_history, but only 9 top-level assistant messages.In a separate earlier affected task, recovery succeeded only because a pre-rewrite Windows shadow copy was still available. That recovered rollout was approximately 1.46 GB and contained 145,824 records, including 8,869 assistant messages and 763 user messages.
This Windows evidence supports the original report: the durable transcript appears to be destructively rewritten before or independently of the subsequent history projection/index migration. Once that rewrite has occurred, rebuilding the index cannot recover the discarded assistant messages.
No project files, raw transcripts, local paths, hashes, or task IDs are included in this public comment. In-app diagnostic feedback has also been submitted, and the feedback/session ID can be provided privately to an OpenAI maintainer.
MikelEguren commentedon Sep 13, 2026
Additional Windows reproduction (sanitized), observed 2026-09-13:
Expected: context compaction must not silently remove the user-visible conversation; if storage or projection cannot restore it, the app should show an explicit recoverable error and provide a supported non-destructive path.
No conversation text, project names, task IDs, local paths, credentials, raw logs, transcript files, or screenshots are included. No source transcript or database was edited.
sonicscrewdriver-leo commentedon Sep 14, 2026
I can confirm a closely matching failure on Windows, with three affected long-running threads and a second history-projection failure observed during the same investigation. I filed a separate Windows case at #45350 and am linking it here because the rollout evidence strongly supports the compaction rewrite described in this issue.
Environment
OpenAI.Codex_26.908.4834.0_x64codex-cli:0.154.0-alpha.6.20.146.0-alpha.9.2and0.147.0-alpha.6.6Sanitized rollout evidence
All three current rollouts begin with
session_metafollowed immediately by onecompactedrecord. No ordinary user or assistant messages exist before it. The compactedmessagefield is empty.replacement_historycontains 81 user items, three developer items, and one encrypted compaction item. Only 15 top-level assistant messages remain after the compacted record.replacement_historycontains 132 user items, three developer items, and one encrypted compaction item. Only 22 top-level assistant messages remain.replacement_historycontains 78 user items, three developer items, and one encrypted compaction item. Only 20 top-level assistant messages remain.The initial compacted records are byte-identical to a backup made before any local repair. Rebuilding the SQLite history projection restored later explicit messages but could not restore the earlier assistant transcript because those source records are absent from the current rollouts.
Secondary projection failure
Thirteen ordinary threads had completed message events in their JSONL source but no history items. After a full backup, rebuilding the projection restored 209 message items. A subsequent audit found source/index parity across 55 ordinary threads and complete app-server pagination for 53 content-bearing threads. This fixed the visibility/index layer only.
No predecessor rollout was found in active or archived sessions, Codex caches, package storage, logs, temporary files, Recycle Bin, or older local databases. Windows File History was not configured, and an elevated VSS/restore-point check found no snapshots.
This appears consistent with the original report: destructive rollout rewrite first, followed by a migration/projection failure that compounds the visible loss. No conversation text, task names, thread/window IDs, local paths, credentials, raw logs, or transcript files are included in this public comment.
jsegeren commentedon Sep 22, 2026
This is a strong example of why the live Codex store should not be the only durable copy.
Disclosure: I maintain Codex Migrate + Vault, an independent Mac tool. Vault keeps encrypted, versioned snapshots of local Codex conversations in a folder the user controls—including OneDrive, Google Drive, or iCloud—and provides verification, search, export, and guarded recovery.
It cannot reconstruct content destroyed before the first snapshot, but a pre-compaction snapshot would preserve the original rollout instead of requiring a lucky Time Machine snapshot. I’d be happy to test this exact failure mode using a redacted fixture and personally help with setup.
App: https://migrate.segeren.com/
Free MIT source: https://github.com/jsegeren/codex-migrate
jsegeren commentedon Sep 22, 2026
Update after more disposable tests on macOS Codex CLI 0.155.0-alpha.16. These are CLI hook results, not a reproduction of the desktop rollout rewrite reported here.
thread/compact/startruns on the same binary, compaction completed without a hook notification or checkpoint. The hook was configured and listed as enabled but hadtrustStatus: modified, so this does not distinguish a trust skip from a missing app-server invocation.This still does not establish whether the affected desktop/app-server on-disk rewrite invokes PreCompact before replacing the durable rollout. Even if it does, the timeout path leaves a loss window. The robust upstream fix is to keep the durable transcript independent of compacted model context, or retain a verified predecessor before any destructive rewrite; history projection should not report success after projecting zero items. Could maintainers confirm desktop rewrite ordering and whether a fail-closed error/timeout option is planned for PreCompact? Versioned backups remain useful, but can recover only the last verified capture, not content already destroyed before it.