Repository navigation
fix(codex): render committed compaction as a timestamped boundary - #1386
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A compacted rollout line's payload has no type, so the mapper's early return swallowed every one (about 1,500 local lines) and Codex compaction never rendered. The dead branch also had two latent bugs. The boundary had no timestamp, so it would sort to the bottom of the feed. And it replayed replacement_history: the retained instructions and earlier prompts, which repainted prompts already in the feed (17,326 of 20,343 sampled replacement messages). Compaction is now handled before the type guard. It maps to a timestamped boundary, plus the summary only when the CLI wrote a readable message (older CLIs; 0.15x encrypts it). replacement_history is never replayed, and the boundary no longer embeds the whole payload (retained prompts plus a 13-23 KB encrypted blob) as compactMetadata, which nothing reads. Codex catalog entries are added for the durable boundary and summary. The curated-fixture sweep now names system entries type:subtype like the bundle sweep, which no curated fixture had exercised. Fixes #1289 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ument the resumed-compaction gap Review a of #1386: the agent read API counted the synthetic compaction summary as a user message. The mapper comment claimed retained history is always a duplicate; resumed rollouts that start with compacted are the exception (follow-up #1393). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Disposition for review a (head ed37d2d)
|
…w c nit) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Disposition for review c (MERGE-READY; head
|
…ordinal (review b) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Disposition for review b (MERGE-READY; head
|
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1289.
Plan:
docs/plans/2026-09-27-codex-compaction-boundary.md(first commit).Problem, measured on about 1,500 local
compactedrollout linescompactedline's payload has notype, somapCodexRolloutToFeedEntries's early return swallowed every one, and thecompactedbranch never ran.rendering/model/order.tssorts timestamp-less rows to the end, so it would paint at the bottom of the feed.replacement_history, the context Codex retains: developer instructions, AGENTS.md, earlier user prompts, and from 0.155 an encryptedcompactionsummary item. That would repaint prompts already in the feed: 17,326 of 20,343 sampled replacement messages duplicate an earlier user message.compactMetadata: retained prompts and a 13–23 KB encrypted blob, kept on a feed entry and in every debug bundle. Nothing in the app reads a Codex boundary's metadata.Change
compactedis handled before the payload-type guard. It maps to a timestamped boundary, plus the summary when the CLI wrote a readablemessage: 56 of about 1,500, all older CLIs; 0.15x encrypts it.replacement_historyis not mapped. Known gap, not a regression: 82 local rollouts are resumed files that start withcompacted, so there the retained prompts are the only copy of the earlier conversation. Before this PR nocompactedline rendered at all. A line-at-a-time mapper cannot tell that case apart, so it is tracked in bug(codex): a resumed rollout that starts withcompactedhides its retained earlier prompts #1393.type: 'user'entry.orchestrationMcp.ts's tail summary, full message list and cheap count now skip it through one type-guard predicate, matching the feed, the preview andlatestUserPrompts. This also fixes the same latent case for Claude summaries.compactMetadata, which also gives one stable rendering shape.codex.entry.system-compact-boundary.v1andcodex.entry.compact-summary.v1are added, with the sameshared.compactiondispositions as Claude's durable entries.bundleShapeSweep.ts) now names non-conversation entriestype:subtype, like the bundle sweep and EntryRow. No curated fixture held a system entry before, so a catalog entry forsystem:compact_boundarycould never match its own fixture.Tests
The fixture is two real
compactedlines: 0.157.0 (empty message, encryptedcompactionitem) and an older one with a readable summary. Keys, item types, roles and ids are verbatim. Every other string is replaced by the same number ofxcharacters, and privacy assertions ran over the result.compaction.committed.evidence.renderer.test.tsxchecks:shared.compactionand classifyknown-claimed;casescarrier equals the mapper output.orchestrationMcp.compactSummary.test.ts(red before the fix): the real older line, through the real mapper, givesmessageCount0 and no messages. A real prompt beside it is still reported.Red on main: six of the seven tests in the two new files. The mapper returns
[]; the one green test is the real-prompt control. (Review c counted it; an earlier body said three.)Known follow-ups
compactedhides its retained earlier prompts #1393: resumed rollouts that start withcompacted.Verification
npx tsc -bclean at ed37d2d.27ba05cachanges only comments.src/renderer/src/workspaceandsrc/providers/codex: 205 files, 1,512 tests.src/providers,src/renderer/src/renderingandsrc/renderer/src/features/feed: 158 files, 1,141 tests, includingshapes.coverage.scripts/audit-rendering-shapes.mtsexits 0.🤖 Generated with Claude Code