feat(schedule): 任务按会话 id 全权代办 + op=list 改名,移除微信 /tasks 命令

用户拍板三点:/tasks 对用户是认知负担删掉(能力收进 schedule 工具);list_all 改名 list;
get/update/delete 支持 id 寻址跨会话代办——绝不引导用户 /switch 切会话(用户不会切,AI 代办)。

- executor toolScheduleTask:target() 解析 id(省略/'0'=本会话,兼容旧调用;否则查存在+同用户,
  不静默降级防拿错目标);get/update/delete 全线作用域化,回执标注(会话 xxx);
  create 收窄仅本会话(外部 id 直接报错说明「定时即下班」语义);list 输出行首挂
  id=task-xxx、尾部指引改/删带 id 直接办,清除所有 /switch 文案;
- scheduler:getTask 补 SELECT brief(M4 起 get 显示的「简介」一直在空转的真 bug,
  本次探针揪出);update/delete 报错「本会话」字样中性化为「该会话」;listUserTasks 注释同步;
- definitions.json:description 重写(任务以所属会话 id 指认;list 是代办入口;create 拒 id);
  enum list_all→list;新增 id 参数说明;
- channel.js:/tasks 命令整套拆除(CMDS/HELP/handleSend 分支/tasksReply/scheduler require),
  旧用户发 /tasks 会得到「不是有效命令 + /help 引导」自然退化。

探针 12 项全过:list 带 id 无切会话引导 / get·update·delete 跨会话 / 跨用户拒 /
查无会话报错 / create 拒外部 id / create 本会话+下班标记 / 无 id 与 id=0 兼容 / list_all 退役报错。
This commit is contained in:
2026-09-29 16:52:02 +08:00
parent 147f0654c5
commit 0e35a99e45
4 changed files with 52 additions and 53 deletions
+8 -4
View File
@@ -292,7 +292,7 @@
"type": "function",
"function": {
"name": "schedule",
"description": "Manage the recurring scheduled task bound to the CURRENT session. At most one task per session; it is deleted together with the session. At each trigger, the prompt is sent to this session as a new user message. 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.\n\nop=get No arguments.\nop=list_all No arguments. Lists every scheduled task of the current user across all sessions (update/delete still act on the CURRENT session only; other rows name their session id so the user can switch there).\nop=create Requires cron_expr, prompt and brief.\nop=update Requires at least one of cron_expr, prompt; only the given fields change.\nop=delete No arguments.",
"description": "Manage your scheduled tasks (alarms). Each task lives on exactly one session (at most one per session) and is addressed by its home session id — the same id op=list shows (e.g. 'task-20260929-003'); omit id (or '0') to act on THIS session's task. At each trigger the prompt is delivered to the task's session as a new user message. 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.\n\nop=get Optional id (default: this session).\nop=list No arguments. Every task of the current user across all sessions, each row starting with its id — hand that id to get/update/delete to act on any task directly; never ask the user to switch sessions.\nop=create Always targets THIS session (id is rejected). Requires cron_expr, prompt and brief. After creating, this session retires into the task's dedicated home (archived; the user's next message starts a fresh session).\nop=update Optional id. Requires at least one of cron_expr, prompt; only given fields change.\nop=delete Optional id. Cancels that task.",
"parameters": {
"type": "object",
"required": [
@@ -303,12 +303,16 @@
"type": "string",
"enum": [
"get",
"list",
"create",
"update",
"delete",
"list_all"
"delete"
],
"description": "Operation to perform on the current session's scheduled task."
"description": "Operation to perform. Tasks are addressed by their home session id."
},
"id": {
"type": "string",
"description": "Task handle: the session id the task lives on, exactly as listed by op=list. Omit (or '0') to act on THIS session's task. Allowed with get/update/delete; op=create rejects it (new tasks always live in this session)."
},
"cron_expr": {
"type": "string",