Skip to content

fix(codex): a resumed rollout that starts with compacted shows its retained prompts - #1410

Closed
Juliusolsson05 wants to merge 2 commits into
mainfrom
fix/codex-resumed-compaction-history
Closed

Juliusolsson05 wants to merge 2 commits into
mainfrom
fix/codex-resumed-compaction-history

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Fixes #1393. Depends on #1386, which maps compacted at all. The PR is based on that branch, so this diff shows only the #1393 change. It cannot join a batch before #1386 merges.

Plan: docs/plans/2026-09-27-codex-resumed-compaction-history.md.

Problem

Change

The stateful createCodexTranscriptEntryMapper knows when it is at a file's head: a session_meta line with no conversation record since.

  • session_meta marks the head. 0 of 2,579 local rollouts have a session_meta after a conversation record.
  • At the head, a compacted line also maps its retained user prompts (mapCodexRetainedUserHistory), before the boundary.
    • They go through the same synthetic filter as ordinary user rows: bootstrap and subagent notifications are dropped.
    • Developer items and the encrypted compaction item are skipped.
  • Mid-file pages and live bursts are unaffected. They never have a session_meta first, so they never map retained prompts.
  • No loader or shared-type change.

Tests (resumedHeadCompaction.test.ts, the real mapper)

The fixture is the real head of a 0.145.0 rollout that starts with compacted. Text is redacted to the same length, except the two bootstrap marker prefixes the filter recognises. I checked every leaf.

  • The head gives 7 prompts (8 retained, minus the bootstrap) and then the boundary, all at the line's time. Red on fix(codex): render committed compaction as a timestamped boundary #1386.
  • The same page without session_meta gives only the boundary.
  • A compaction after conversation in the same file gives only that record and the boundary.
  • Never mapping retained prompts, never leaving the head state, and treating any non-conversation line as the head each fail a test.

Verification

  • npx tsc -b clean.
  • src/providers, src/renderer/src/rendering, features/feed and workspace: 339 files, 2,519 tests.

Not done

The retained prompts render as ordinary user rows; there is no "retained" marker. That styling is a separate UX call.

🤖 Generated with Claude Code

…tained prompts (#1393)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Juliusolsson05 Juliusolsson05 added provider:codex Affects Codex integration type:bug Something works wrong class:C3-silent-failure The app knows it failed and does not say sev:P3 Minor labels Sep 27, 2026
@Juliusolsson05

Copy link
Copy Markdown
Owner Author

Status (W1): held and recommended to park. Reviews a and b are both FIX-BEFORE-MERGE, and the findings go beyond a patch:

  • Most target files are forks. 63 of the 82 head-compacted files are native subagent forks. Their retained history is the parent's conversation (1,954 of 1,957 texts match the parent file), not the child's prompts.
  • Retained items are not all prompts. They include runtime wrappers (<command-name>, <local-command-stdout>, <task-notification>, …), mixed bootstrap blocks, and prompts that the same file replays later.
  • The head is not a stable fact. "At the file head" is only proved inside one mapper. History pages and live bursts can split session_meta from the head compacted, so the proof needs a loader or live-ingestion fact. The live fix would touch useIpcSubscriptions.ts, which three other open PRs change.

After narrowing to non-fork files, the benefit is 19 July-era CLI rollouts. I recommend closing this PR and keeping #1393 open with these findings as the design input: a loader-provided file-head fact, a fork policy, and a user-authored filter. The manager decides.

Base automatically changed from fix/codex-compaction-boundary to main September 27, 2026 13:21
….ts, both exec de-dup and file-head retained prompts kept)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Juliusolsson05

Copy link
Copy Markdown
Owner Author

Closed by B6 (manager, owner proxy) during the owner's PR freeze: 7 review findings are still open and it can't converge under the freeze. Nothing is deleted. The branch stays on origin and the PR can be reopened. The linked issue stays open with this PR's findings as its starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

class:C3-silent-failure The app knows it failed and does not say provider:codex Affects Codex integration sev:P3 Minor type:bug Something works wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(codex): a resumed rollout that starts with compacted hides its retained earlier prompts

1 participant