Repository navigation
feat(conversations): Read background compaction events and check history version on replace - #2600
Merged
Merged
Conversation
…ory version on replace Co-Authored-By: Thomas Jiang <20501235+thomasjiangcy@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
1 screenshot change — 1 changed · 0 added · 0 removed Review screenshots in Frameshift
|
thomasjiangcy
approved these changes
Nov 3, 2026
This was referenced Nov 3, 2026
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.
Reader side for background compaction. Nothing writes these events yet.
Ship order: this must go out in a release before any PR that writes
compaction_requestedorcompaction_prepared. Older code decodes unknown types asunknown, and projection throws on them, so every turn would fail for a conversation that has one of these rows. The schemas are strict, so a later field addition by the writer also needs a reader release first.Events (appendable, schema version 1):
compaction_requested:markSeq(last event seq the summary covers),historyVersion,modelProfile,modelId.compaction_prepared: the same fields plusoutcome.readyrequiressummary;failedrequireserrorType(a fixed label, max 64 chars, no exception text).Readers:
compactionevent that swaps it in.replaceHistorytakes an optionalexpectedHistoryVersion. It is checked under the conversation event lock. On mismatch it writes nothing and returns{ status: "conflict", historyVersion: current }. Otherwise it returns{ status: "replaced", historyVersion: new }. Existing callers pass nothing and keep current behavior.Open question: should the dashboard show prepared/failed background compactions? This PR leaves them out of reporting.
via @thomasjiangcy.
--
View Session [Sentry]