fix(channels): keep the compaction outcome visible, gate only the start notice

Rework after review: compaction changes the context of every later turn,
so its outcome (compacted / failed / cancelled) is always delivered,
whether the user or the scheduler started it. Only the transient
"Compressing context…" start notice follows the channel's send_progress
setting, so a channel with progress off receives one notice per
compaction instead of two. The manual flag is gone.
This commit is contained in:
L4XB authored and chengyongru committed 2026-09-11 11:15:57 +08:00
1 parent 92f151ae67
commit a068de8068
6 files changed
+25 -31

No files matched your search

+6 -6
View File
@@ -811,14 +811,14 @@ class ChannelManager:
):
continue
# Automatic compaction notices are maintenance chatter, so they
# follow the channel's progress setting like other progress
# text. A user-requested ``/compact`` and a failed compaction
# are still reported.
# Compaction changes the context of every later turn, so its
# outcome (compacted / failed / cancelled) is always delivered.
# The "Compressing context…" start notice is transient progress
# text and follows the channel's progress setting, so a channel
# with progress off gets one notice per compaction, not two.
if (
isinstance(event, ContextCompactionEvent)
and not event.manual
and event.phase != "failed"
and event.phase == "started"
and not self._should_send_progress(msg.channel)
):
continue