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

+5 -1
View File
@@ -1487,12 +1487,16 @@ def _client_projection_event(
or phase not in {"started", "succeeded", "failed", "cancelled"}
):
return None
return {
projected = {
"event": "context_compaction",
**common,
"compaction_id": compaction_id,
"phase": phase,
}
reason = record.get("reason")
if isinstance(reason, str) and reason in {"idle", "context_pressure", "manual", "provider_native"}:
projected["reason"] = reason
return projected
if event == "turn_end":
projected = {"event": "turn_end", **common}