Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

docs(verdichtung) newestCompaction sagt jetzt, wofuer es NICHT da ist

David259d50dad91e
diff --git a/src/lib/run-compact-command.ts b/src/lib/run-compact-command.ts
index 8ef8a853..cdb4bd4a 100644
--- a/src/lib/run-compact-command.ts
+++ b/src/lib/run-compact-command.ts
@@ -149,7 +149,17 @@ export async function runCompactForConversation(opts: {
return { ok: true, record }
}
-/** The newest record, or undefined. Only the newest shapes a payload. */
+/**
+ * The newest record, or undefined.
+ *
+ * NOT for building a payload. That takes the whole chain, because each run
+ * only summarises what the previous one did not cover, and a cut placed by the
+ * newest anchor drops everything the earlier summaries stand for
+ * (`applyStoredCompaction` in `compact-summary.ts`, fixed 04.09.2026). This
+ * function exists for one thing only: `atMessageCount`, which the counter and
+ * the auto trigger read to answer "how much has been said since the last
+ * summary". Both callers are in this file and in `TokenCounter.tsx`.
+ */
export function newestCompaction(
compactions: CompactionRecord[] | undefined,
): CompactionRecord | undefined {