fix: hide internal cron prompts from webui

This commit is contained in:
chengyongru
2026-06-12 18:17:28 +08:00
parent a50b3ac0f2
commit 32d8a1dd7b
6 changed files with 97 additions and 0 deletions
+3
View File
@@ -17,6 +17,7 @@ from urllib.parse import unquote, urlparse
from loguru import logger
from nanobot.config.paths import get_webui_dir
from nanobot.cron.session_turns import CRON_HISTORY_META
from nanobot.session.manager import SessionManager
from nanobot.webui.metadata import WEBUI_MESSAGE_SOURCE_METADATA_KEY, WEBUI_TURN_METADATA_KEY
@@ -854,6 +855,8 @@ def _session_user_event(
) -> dict[str, Any] | None:
if message.get("role") != "user":
return None
if message.get(CRON_HISTORY_META) is True:
return None
content = message.get("content")
text = content if isinstance(content, str) else ""
media = message.get("media")