Repository navigation
feat(compaction): Swap in prepared background summaries - #2605
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A conflicting replacement means the active messages are stale. The blocking summary wrote them without a version check, which could drop the other replacement.
thomasjiangcy
approved these changes
Nov 3, 2026
sentry-junior
Bot
force-pushed
the
compaction-swap-prepared-summary
branch
from
November 3, 2026 13:38
9c9691b to
e1775f3
Compare
Contributor
|
1 screenshot change — 1 changed · 0 added · 0 removed Review screenshots in Frameshift
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e1775f3. Configure here.
Trimming took the last user message as the Turn boundary. Runtime context and summaries are user messages too, so context added after a Turn's tool results got those results cleared. Use the last Turn instruction as the boundary.
This branch was successfully deployed
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.

Stacked on #2602 (base
compaction-summary-main-model). Retarget tomainonce #2602 merges. Depends on the event schemas from #2600, which are already released.Reads
compaction_preparedevents and swaps a ready summary into history without a model call. A separate PR adds the job that writes these events. Until it merges, nothing in prod writes them, so this PR changes no behavior there.When a swap runs
outcomeisready;historyVersionandmodelProfilematch the current ones;Replacement history
markSeq(withsourceEventSeq), then pending messages.replaceHistory(..., { expectedHistoryVersion }). On a conflict, the summary is discarded and nothing is written.Tool-result trimming (
tool-result-trimming.ts)readConversationEvent({ seq }).[image cleared: <tool>, seq N].Telemetry: a swap gets its own
agent.context_compactionspan. Its attributes are:app.compaction.outcome:applied/not_ready/discarded;app.compaction.discard_reason;The mode (
blocking/active) gives the swap point. The details are inTELEMETRY.md.Decisions for review
split_tool_callis an extra discard reason. It applies when the first message after the mark is a tool result, because the mark falls between a tool call and its result.historyVersiondoesn't match, but it was appended in the current version) is reported asdiscardedon every Turn until the next replacement.continuity.eval.tscan't pass yet. Its compaction is the blocking path, which keeps no tool results. It needs the background job to writecompaction_preparedfirst.via @thomasjiangcy.
--
View Session [Sentry]