Skip to content

🤖 fix: keep the workspace creation card at the transcript start after compaction - #4252

Merged
ibetitsmike merged 2 commits into
mainfrom
mike/init-card-compaction
Sep 14, 2026
Merged

ibetitsmike merged 2 commits into
mainfrom
mike/init-card-compaction

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

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.getDisplayedMessages splices it in after the first visible user row. Once a transcript is loaded from the latest context boundary (fresh load, reconnect, or the live pruneBeforeLatestBoundary path), 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. No compaction-boundary row 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.
  • Fork exception: a fork copies compacted history verbatim and then runs its own init, so its creation happened inside the loaded window. The helper compares the init start time with the boundary's timestamp and hides the card only on positive evidence that the init predates the boundary; an undated boundary keeps the card visible. Without this, forking a compacted workspace would show "Creating workspace" and then drop the card on completion.
  • To make that comparison possible, compaction-boundary display rows now carry the summary message's timestamp (DisplayedMessage type plus createCompactionBoundaryRow).

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 old findIndex insertion 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

… 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 -->
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T12:08:31.513948Z 11114da Manual request
🔒 Security Review Completed 2026-09-14T12:08:36.665473Z 11114da Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: d7bda6637c

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/browser/utils/messages/StreamingMessageAggregator.ts Outdated
…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.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 11114daf01

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 11114daf01

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ibetitsmike
ibetitsmike added this pull request to the merge queue Sep 14, 2026
Merged via the queue into main with commit d18a94c Sep 14, 2026
35 of 38 checks passed
@ibetitsmike
ibetitsmike deleted the mike/init-card-compaction branch September 14, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant