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:
chengyongru authored and GitHub committed 2026-09-08 13:16:45 +08:00
1 parent c039a7052a
commit 3548aec576
18 files changed
+335 -271

No files matched your search

+3 -3
View File
@@ -209,7 +209,7 @@ class RuntimeClient:
return self._loop.bus.subscribe(handler, SessionTurnPersisted)
async def compact_session(self, session_key: str) -> SessionSnapshot:
"""Archive one session through the shared idle-compaction path."""
"""Summarize one session and exclude its archived messages from replay."""
session = self._loop.sessions.get_or_create(session_key)
runtime = self._loop.runtime_for_session(session)
await self._loop.consolidator.compact_idle_session(
@@ -218,8 +218,8 @@ class RuntimeClient:
)
return snapshot_from_session(self._loop.sessions.get_or_create(session_key))
async def compact_idle_session(self, session_key: str, *, max_suffix: int = 8) -> str | None:
"""Run idle-session compaction for one session and return the summary."""
async def compact_idle_session(self, session_key: str, *, max_suffix: int = 0) -> str | None:
"""Return a replacement summary; legacy ``max_suffix`` no longer retains history."""
session = self._loop.sessions.get_or_create(session_key)
runtime = self._loop.runtime_for_session(session)
return await self._loop.consolidator.compact_idle_session(