From 290527d2b7f4a3380297983fe30d697c785e3e6d Mon Sep 17 00:00:00 2001 From: kicer Date: Tue, 22 Sep 2026 22:36:19 +0800 Subject: [PATCH] =?UTF-8?q?schedule=5Ftask:description=E8=A1=A5=E6=97=B6?= =?UTF-8?q?=E5=8C=BA/=E6=9C=80=E5=B0=8F=E9=97=B4=E9=9A=94=E8=AF=AD?= =?UTF-8?q?=E4=B9=89/=E8=BE=93=E5=87=BA=E5=BD=92=E5=B1=9E=E5=A5=91?= =?UTF-8?q?=E7=BA=A6(=E8=AF=84=E5=AE=A1#1#4);cron=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=9B=9E=E6=98=BE=E8=BE=93=E5=85=A5(?= =?UTF-8?q?=E8=AF=84=E5=AE=A1#3);list=E5=B7=A5=E5=85=B7=E4=B8=8D=E5=8A=A0(?= =?UTF-8?q?=E6=9F=A5=E9=87=8D=E9=94=99=E5=B7=B2=E5=90=AB=E5=9B=9E=E6=98=BE?= =?UTF-8?q?+=E6=8C=87=E5=BC=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/server/scheduler.js | 4 ++-- app/server/tools/definitions.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/server/scheduler.js b/app/server/scheduler.js index 04f79f6..05af9b2 100644 --- a/app/server/scheduler.js +++ b/app/server/scheduler.js @@ -41,9 +41,9 @@ function validateCron(cronExpr) { first = it.next().getTime(); second = it.next().getTime(); } catch (e) { - throw new Error('cron 表达式无效: ' + (e && e.message || e)); + throw new Error('cron 表达式无效: ' + cronExpr + ' → ' + (e && e.message || e)); } - if (second - first < MIN_INTERVAL_MS) throw new Error('定时任务间隔不能小于 1 小时'); + if (second - first < MIN_INTERVAL_MS) throw new Error('定时任务间隔不能小于 1 小时:' + cronExpr + ' 相邻两次触发不足 1h'); return first; } diff --git a/app/server/tools/definitions.json b/app/server/tools/definitions.json index ca19543..e954df9 100644 --- a/app/server/tools/definitions.json +++ b/app/server/tools/definitions.json @@ -103,18 +103,18 @@ "type": "function", "function": { "name": "schedule_task", - "description": "Create a recurring scheduled task for the CURRENT session. At each trigger, the given prompt is sent to this session as a new user message. Only one task per session is allowed; if one already exists the call fails and the user must delete it first in the session view. Call this ONLY when the user explicitly asks for something to run periodically or at a specific time.", + "description": "Create a recurring scheduled task for the CURRENT session. At each trigger, the given prompt is sent to this session as a new user message. Only one task per session is allowed; if one already exists the call fails and the user must delete it first in the session view. Schedule times are interpreted in Asia/Shanghai (UTC+8). Call this ONLY when the user explicitly asks for something to run periodically or at a specific time.", "parameters": { "type": "object", "required": ["cron_expr", "prompt"], "properties": { "cron_expr": { "type": "string", - "description": "Standard 5-field cron expression, e.g. '0 9 * * *' for 09:00 every day. Minimum interval is 1 hour." + "description": "Standard 5-field cron expression in Asia/Shanghai (UTC+8), e.g. '0 9 * * *' for 09:00 Beijing time every day. The interval between two consecutive runs must be at least 1 hour." }, "prompt": { "type": "string", - "description": "The message to send to this session at each trigger. Write it as a self-contained instruction, because previous conversation history is archived before each run." + "description": "The message to send to this session at each trigger. Write it as a self-contained instruction: previous conversation history is archived before each run, so this prompt is the only input the model will see. The output stays in this session for the user to view; if it must reach the user proactively, state how in the prompt (e.g. via a skill or webhook)." } } }