fix(cron): fix timezone display bug, add tz validation and skill docs

This commit is contained in:
Re-bin
2026-02-17 08:30:52 +00:00
parent 2c3a568e46
commit 6bae6a617f
5 changed files with 24 additions and 13 deletions

View File

@@ -99,6 +99,12 @@ class CronTool(Tool):
return "Error: no session context (channel/chat_id)"
if tz and not cron_expr:
return "Error: tz can only be used with cron_expr"
if tz:
from zoneinfo import ZoneInfo
try:
ZoneInfo(tz)
except (KeyError, Exception):
return f"Error: unknown timezone '{tz}'"
# Build schedule
delete_after = False