You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(codex): a resumed rollout that starts with compacted hides its retained earlier prompts #1393
In the local corpus, 82 rollout files (68 native sessions, 19 of them source: "cli") have a first compacted record that comes before every response_item and event_msg.
In each of those files, replacement_history holds plain, non-bootstrap user text. That text is the only copy of the earlier conversation in the file.
58 of those sessions have no other rollout file locally.
One concrete 0.149.0 CLI file: two session_meta records, then a compacted record holding 17 retained user messages, then world_state, turn_context and the later responses.
After fix(codex): render committed compaction as a timestamped boundary #1386, the line renders as a boundary, plus the readable summary when there is one. replacement_history is still never mapped, because in the common case it only duplicates earlier prompts: 33,443 of 37,724 retained user items have an exact earlier match.
So opening or previewing one of these resumed sessions shows only "Conversation compacted", with none of the 17 prompts.
Why the mapper cannot fix it alone
mapCodexRolloutToFeedEntries maps one line at a time. A paged older-history load can start a page with a compacted line whose predecessors sit in the previous page, so "first line in this mapping pass" is not the same as "first line in the file".
Direction
Where the history loader (initial, older-page and preview paths) knows it is mapping from file offset 0, map the retained user messages of a compacted record that no conversation record precedes. Mark them as retained history, and skip developer instructions and the encrypted compaction item. Add a recorded initial-compacted regression case, with fixtures redacted at the same length.
Closed attempt: #1410 (branch fix/codex-resumed-compaction, kept; main merged at b0e9ae8f; reopenable). It mapped a rollout's head compacted record's retained user prompts, gated on a session_meta head marker (atFileHead in mapper.ts, mapCodexRetainedUserHistory). The recorded fixture testing/fixtures/codex/compaction/resumed-head-compacted.json and the corpus counts in its plan are reusable. Open findings from round 1 (reviews a, b, c):
P1: retained runtime messages are promoted to user prompts. Injected context (AGENTS, environment, <recommended_plugins>) inside the retained history renders as user rows. The role filter is untested; removing it passes the suite.
P1: live one-record bursts, and pagination that splits session_meta from the head compacted line, permanently lose the prompts. Head state is per-mapper, and history pages and live bursts each build their own. A fix needs head state seeded from the loader (e.g. offsets[0] === 0), which touches useIpcSubscriptions.ts.
P2: inherited fork context counts as the child's prompts. 63 of 82 target files are forks carrying the parent's context.
P2: some retained prompts are replayed later in the same file (duplicates).
P2: mixed bootstrap blocks remain visible inside retained user rows.
Low:<recommended_plugins> double-renders in 4 corpus files; one residue class of page boundaries is still lost.
Activity
fix(orchestration): a compaction summary is not an agent message; doc…
Juliusolsson05 commentedon Sep 27, 2026
Closed attempt: #1410 (branch
fix/codex-resumed-compaction, kept; main merged atb0e9ae8f; reopenable). It mapped a rollout's headcompactedrecord's retained user prompts, gated on asession_metahead marker (atFileHeadinmapper.ts,mapCodexRetainedUserHistory). The recorded fixturetesting/fixtures/codex/compaction/resumed-head-compacted.jsonand the corpus counts in its plan are reusable. Open findings from round 1 (reviews a, b, c):<recommended_plugins>) inside the retained history renders as user rows. The role filter is untested; removing it passes the suite.session_metafrom the headcompactedline, permanently lose the prompts. Head state is per-mapper, and history pages and live bursts each build their own. A fix needs head state seeded from the loader (e.g.offsets[0] === 0), which touchesuseIpcSubscriptions.ts.<recommended_plugins>double-renders in 4 corpus files; one residue class of page boundaries is still lost.