fix: hide internal cron prompts from webui

This commit is contained in:
chengyongru committed 2026-06-12 18:17:28 +08:00
1 parent a50b3ac0f2
commit 32d8a1dd7b
6 files changed
+97

No files matched your search

+5
View File
@@ -14,6 +14,7 @@ from typing import Any
from loguru import logger
from nanobot.cron.session_turns import CRON_HISTORY_META
from nanobot.session.manager import (
_SESSION_LIST_PREVIEW_MAX_CHARS,
_SESSION_LIST_PREVIEW_MAX_RECORDS,
@@ -142,6 +143,8 @@ def _preview_from_messages(messages: list[dict[str, Any]]) -> str:
or scanned_chars > _SESSION_LIST_PREVIEW_MAX_CHARS
):
break
if item.get(CRON_HISTORY_META) is True:
continue
text = _message_preview_text(item)
if not text:
continue
@@ -193,6 +196,8 @@ def _scan_session_row(session_manager: SessionManager, path: Path) -> dict[str,
item = json.loads(line)
if item.get("_type") == "metadata":
continue
if item.get(CRON_HISTORY_META) is True:
continue
text = _message_preview_text(item)
if not text:
continue