fix: use summary checkpoints for all compaction triggers (#5694)
* fix: exclude archived history after manual compaction * refactor: share summary checkpoints across compaction paths * fix: use summary checkpoints for every compaction trigger * test: assert replay starts at the archived boundary * fix: preserve nothing summaries without raw fallback * test: assert compaction results positively * test: verify checkpoint continuation after session reload
This commit is contained in:
1 parent
c039a7052a
commit
3548aec576
18 files changed
+335
-271
No files matched your search
@@ -92,6 +92,9 @@ function sameMessageShape(a: MessageShape, b: MessageShape): boolean {
|
||||
function latestComposerContextUsage(messages: UIMessage[]): ComposerContextUsage | null {
|
||||
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
||||
const message = messages[index];
|
||||
if (message.kind === "compaction" && message.compaction?.phase === "succeeded") {
|
||||
return null;
|
||||
}
|
||||
const contextTokens = message.usage?.context_tokens;
|
||||
if (
|
||||
message.role !== "assistant"
|
||||
|
||||
Reference in new issue
Block a user