scheduler: AI 侧与管理面——schedule_task 工具(sessionId 取自 ctx,校验在 createTask)+ 会话详情 schedule 字段 + DELETE /:id/schedule(只落 scheduler_note 通知,不触发 AI)

This commit is contained in:
2026-09-19 22:24:40 +08:00
parent 4403256fa9
commit f1687ab7ce
3 changed files with 61 additions and 0 deletions
+21
View File
@@ -247,6 +247,27 @@
}
}
},
{
"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.",
"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."
},
"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."
}
}
}
}
},
{
"type": "function",
"function": {