Split out of the review of LibreChat-AI#16436 — LibreChat-AI#16436 (comment).
What happens
While a manual compaction is live and has emitted its created event, a page reload or replica handoff rebuilds the turn from resume state. trackUserMessage replaces the identity-only anchor projection with the loaded leaf shape (including its parentMessageId), and getResumeState exposes only isRegenerate, not the job's compact flag. The client therefore fails isCompactionAnchorProjection, treats the anchor as a submitted user row, and mergeResumeMessages can blank a user leaf or flip an assistant leaf to isCreatedByUser: true.
Expected
The compaction identity survives the resume contract: either the anchor projection is preserved through trackUserMessage, or compact is included in the client-safe resume state and the merge treats the row as an anchor, not a submitted user message.
That PR ships the server-side persistence identity; the resume contract and the client's reconnect merge are a separate surface spanning data-provider types and client merge logic.
Split out of the review of LibreChat-AI#16436 — LibreChat-AI#16436 (comment).
What happens
While a manual compaction is live and has emitted its
createdevent, a page reload or replica handoff rebuilds the turn from resume state.trackUserMessagereplaces the identity-only anchor projection with the loaded leaf shape (including itsparentMessageId), andgetResumeStateexposes onlyisRegenerate, not the job'scompactflag. The client therefore failsisCompactionAnchorProjection, treats the anchor as a submitted user row, andmergeResumeMessagescan blank a user leaf or flip an assistant leaf toisCreatedByUser: true.Expected
The compaction identity survives the resume contract: either the anchor projection is preserved through
trackUserMessage, orcompactis included in the client-safe resume state and the merge treats the row as an anchor, not a submitted user message.Why it is out of scope for LibreChat-AI#16436
That PR ships the server-side persistence identity; the resume contract and the client's reconnect merge are a separate surface spanning data-provider types and client merge logic.