feat(webui): distinguish context compaction reasons (NAN-324) (#6389)

* feat(webui): distinguish context compaction reasons (NAN-324)

* fix(webui): describe idle compaction cancellation as interruption

* docs: omit compaction notice details from configuration guide

* fix(i18n): make compaction notices read naturally

* fix(i18n): keep CJK compaction notices concise

* fix(i18n): describe idle compaction as unfinished
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-22 16:13:25 +08:00
1 parent 084b6bb394
commit bc5c58d239
38 files changed
+540 -23

No files matched your search

+4 -1
View File
@@ -1,3 +1,4 @@
import { isCompactionPhase, isCompactionReason } from "../../../packages/client-events/notifications";
import type {
ApiServicePayload,
AutomationChatsPayload,
@@ -380,7 +381,9 @@ function parseThreadProjectionEvent(value: unknown): ThreadProjectionEvent {
if (value.text !== undefined && typeof value.text !== "string") break;
return value as unknown as ThreadProjectionEvent;
case "context_compaction":
if (typeof value.compaction_id !== "string" || typeof value.phase !== "string") break;
if (typeof value.compaction_id !== "string" || !value.compaction_id
|| !isCompactionPhase(value.phase)
|| (value.reason !== undefined && !isCompactionReason(value.reason))) break;
return value as unknown as ThreadProjectionEvent;
case "turn_end":
return value as unknown as ThreadProjectionEvent;