Split out of the review of LibreChat-AI#16436 — LibreChat-AI#16436 (comment).
What happens
A disconnected manual compaction persists a marker-only snapshot (unfinished: true, error: false) through the allSubscribersLeft handler. When the owning server then shuts down or the job is reaped, no request error path runs settleExistingRowsBeforeErrorTurn: finalizeOwnedJobsForShutdown only claims and finishes the stream job, and the reap path only aborts and removes its runtime. The Mongo row keeps its live-run shape: a partial summary stays unfailed (labeled as a successful user compaction after restart) and a thinking-only snapshot keeps no compaction identity at all.
Expected
The shutdown and reap lifecycle paths run the same failed-compaction finalizer before retiring the job, so no marker-only snapshot survives its owner.
That PR owns the request-driven settlement paths (Stop, error turn); wiring the manager's shutdown and reap lifecycles into message persistence is a separate surface with its own ordering constraints.
Split out of the review of LibreChat-AI#16436 — LibreChat-AI#16436 (comment).
What happens
A disconnected manual compaction persists a marker-only snapshot (
unfinished: true,error: false) through theallSubscribersLefthandler. When the owning server then shuts down or the job is reaped, no request error path runssettleExistingRowsBeforeErrorTurn:finalizeOwnedJobsForShutdownonly claims and finishes the stream job, and the reap path only aborts and removes its runtime. The Mongo row keeps its live-run shape: a partial summary stays unfailed (labeled as a successful user compaction after restart) and a thinking-only snapshot keeps no compaction identity at all.Expected
The shutdown and reap lifecycle paths run the same failed-compaction finalizer before retiring the job, so no marker-only snapshot survives its owner.
Why it is out of scope for LibreChat-AI#16436
That PR owns the request-driven settlement paths (Stop, error turn); wiring the manager's shutdown and reap lifecycles into message persistence is a separate surface with its own ordering constraints.