fix: stop sending context compaction notifications

This commit is contained in:
Arthur K. authored and Xubin Ren committed 2026-09-30 13:44:42 +08:00
1 parent fbe9b4fd72
commit 0b402d0414
31 files changed
+157 -38

No files matched your search

+4 -1
View File
@@ -38,6 +38,7 @@ from nanobot.channels.base import BaseChannel
from nanobot.config.paths import get_media_dir, get_runtime_subdir
from nanobot.config.schema import Base
from nanobot.utils.logging_bridge import redirect_lib_logging
from nanobot.events import ContextCompactionEvent
# ---------------------------------------------------------------------------
# Protocol constants (from openclaw-weixin types.ts)
@@ -1883,13 +1884,15 @@ class WeixinChannel(BaseChannel):
self._record_context_send(context_token)
async def send(self, msg: OutboundMessage) -> None:
event = getattr(msg, "event", None)
if isinstance(event, ContextCompactionEvent) and not event.notify:
return
if not self._client or not self._token:
raise RuntimeError("WeChat client not initialized or not authenticated")
self._assert_session_active()
delivery_id = self._delivery_id(msg)
delivery_state = self._delivery_state(delivery_id)
event = getattr(msg, "event", None)
progress_event = event if isinstance(event, ProgressEvent) else None
is_progress = progress_event is not None