🤖 fix: keep the workspace creation card at the transcript start after compaction - #4252
Conversation
… compaction The creation card was spliced in after the first visible user row, so once the transcript was loaded from (or pruned to) the latest context boundary it landed under the first post-boundary turn. Anchor it to the first user turn of the whole history instead: hide it while a boundary precedes that turn, and show it again once older history brings the original turn back into view. A fork's init runs after the copied boundaries, so its card stays inside the loaded window. --- _Generated with `xum` • Model: `anthropic:claude-fable-5-1` • Thinking: `xhigh`_ <!-- mux-attribution: model=anthropic:claude-fable-5-1 thinking=xhigh -->
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7bda6637c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…es the boundary An undated boundary cannot prove the init belongs to unloaded history, and hiding a running fork init would drop its progress and failure output. Every current boundary producer stamps Date.now(); this pins the fail-safe direction for type-permitted data.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
The "Workspace created in X" card was rendering under the first user turn after a compaction boundary. It now stays anchored to the first user turn of the whole transcript: hidden while that turn lives in unloaded older history, and back in its original place once "Load older messages" brings it into view.
Background
The creation card is not a persisted message.
StreamingMessageAggregator.getDisplayedMessagessplices it in after the first visibleuserrow. Once a transcript is loaded from the latest context boundary (fresh load, reconnect, or the livepruneBeforeLatestBoundarypath), the first visible user row is a post-boundary turn, so the card followed it and looked like the workspace had just been created mid-chat.Implementation
findInitMessageInsertionIndex(aggregator) decides placement. Nocompaction-boundaryrow before the first user row means the transcript start is loaded: insert after that turn, as before. A boundary before it means the original first turn is in older history: hide the card. Paging in an older epoch that itself starts at a boundary keeps it hidden; paging in epoch 0 reveals it after the true first turn.compaction-boundarydisplay rows now carry the summary message'stimestamp(DisplayedMessagetype pluscreateCompactionBoundaryRow).Validation
New cases in
StreamingMessageAggregator.init.test.ts: fresh load from the latest boundary hides the card, older-epoch paging reveals it only once epoch 0 is loaded, live compaction pruning hides it, and a fork whose init postdates the copied boundary keeps it. Red-green both ways: restoring the oldfindIndexinsertion fails the two hide tests, and disabling the timestamp branch fails the fork test.Risks
Low. The change only affects where (or whether) the synthetic creation card appears in the displayed rows; persisted history and provider requests are untouched. The one judgment call is the fork exception: a fork's finished card is treated as belonging to the epoch its init ran in rather than being hidden with the copied history.
Generated with
xum• Model:anthropic:claude-fable-5-1• Thinking:xhigh