mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-08 10:45:52 +00:00
fix(log): remove noisy no-op logs from auto-compact
Remove two debug log lines that fire on every idle channel check: - "scheduling archival" (logged before knowing if there's work) - "skipping, no un-consolidated messages" (the common no-op path) The meaningful "archived" info log (only on real work) is preserved.
This commit is contained in:
parent
d33bf22e91
commit
3c06db7e4e
@ -70,7 +70,6 @@ class AutoCompact:
|
|||||||
continue
|
continue
|
||||||
if self._is_expired(info.get("updated_at"), now):
|
if self._is_expired(info.get("updated_at"), now):
|
||||||
self._archiving.add(key)
|
self._archiving.add(key)
|
||||||
logger.debug("Auto-compact: scheduling archival for {} (idle > {} min)", key, self._ttl)
|
|
||||||
schedule_background(self._archive(key))
|
schedule_background(self._archive(key))
|
||||||
|
|
||||||
async def _archive(self, key: str) -> None:
|
async def _archive(self, key: str) -> None:
|
||||||
@ -79,7 +78,6 @@ class AutoCompact:
|
|||||||
session = self.sessions.get_or_create(key)
|
session = self.sessions.get_or_create(key)
|
||||||
archive_msgs, kept_msgs = self._split_unconsolidated(session)
|
archive_msgs, kept_msgs = self._split_unconsolidated(session)
|
||||||
if not archive_msgs and not kept_msgs:
|
if not archive_msgs and not kept_msgs:
|
||||||
logger.debug("Auto-compact: skipping {}, no un-consolidated messages", key)
|
|
||||||
session.updated_at = datetime.now()
|
session.updated_at = datetime.now()
|
||||||
self.sessions.save(session)
|
self.sessions.save(session)
|
||||||
return
|
return
|
||||||
@ -95,6 +93,7 @@ class AutoCompact:
|
|||||||
session.last_consolidated = 0
|
session.last_consolidated = 0
|
||||||
session.updated_at = datetime.now()
|
session.updated_at = datetime.now()
|
||||||
self.sessions.save(session)
|
self.sessions.save(session)
|
||||||
|
if archive_msgs:
|
||||||
logger.info(
|
logger.info(
|
||||||
"Auto-compact: archived {} (archived={}, kept={}, summary={})",
|
"Auto-compact: archived {} (archived={}, kept={}, summary={})",
|
||||||
key,
|
key,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user