feat: 清理 control_node + 引入 task 一等公民

- control_node 标注 DEPRECATED:保留目录壳子供未来远程探针节点复用,删除调用路径与相关测试
- 新增 task 表:极简元数据持久化 regulatory_node 完成的短任务(出报告/写文件/查询整理)
- regulatory_node 自标注:MessageResponse 扩展 task_action/title/summary,_run 末尾非阻塞落库
- query_task_list 改查 task 表,符合用户对"任务列表"的直觉,与 workflow 体系解耦
- 新增 /api/v1/task/list|/{id} 只读 API(task 由 regulatory 内部触发,不开放对外创建)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 16:30:19 +00:00
parent 005ce566a8
commit 4aa1dab283
20 changed files with 510 additions and 91 deletions
+16 -2
View File
@@ -18,7 +18,13 @@ _PROMPTS: Dict[str, Dict[str, str]] = {
"1. 准确理解用户的意图,提供专业、友好且有帮助的回复。\n"
"2. 如果你有可用工具,可以主动调用工具来辅助回答(如搜索、文件操作等)。\n"
"3. 如果你收到工作流的执行报告,请将其转化为面向用户的清晰总结。\n"
"4. 保持回复简洁、有结构,避免冗余信息。\n"
"4. 保持回复简洁、有结构,避免冗余信息。\n\n"
"【关于短任务(task)】\n"
"如果本次回复完成了一个值得记录的'短任务'(生成文件/出报告/查询整理资料/写代码片段等具体产出),\n"
"请把 task_action 设为 'create_task',并填写:\n"
"- task_title:简短标题(<=80 字,例如 'Python 学习计划'\n"
"- task_summary:结果摘要(说明产出了什么、附件去向)\n"
"闲聊、打招呼、纯问答这类不留下产出物的回复,task_action 留空(None)。\n"
"请保持专业、友好的沟通风格。"
),
"en": (
@@ -28,7 +34,13 @@ _PROMPTS: Dict[str, Dict[str, str]] = {
"1. Accurately understand user intent and provide professional, friendly, and helpful replies.\n"
"2. If tools are available, proactively use them to assist your responses (e.g., search, file operations).\n"
"3. If you receive a workflow execution report, convert it into a clear user-facing summary.\n"
"4. Keep responses concise, well-structured, and free of redundancy.\n"
"4. Keep responses concise, well-structured, and free of redundancy.\n\n"
"[About short tasks]\n"
"If this reply completes a worth-recording short task (generating files / writing reports / collecting information / producing code snippets etc.),\n"
"set task_action to 'create_task' and fill:\n"
"- task_title: short title (<=80 chars, e.g. 'Python learning plan')\n"
"- task_summary: result summary (what was produced, where attachments live)\n"
"Leave task_action empty for chit-chat / greetings / plain Q&A that produce no artifact.\n"
"Maintain a professional and friendly communication style."
),
},
@@ -72,6 +84,8 @@ _PROMPTS: Dict[str, Dict[str, str]] = {
"Ensure all output is logical, rigorous, and high-quality."
),
},
# DEPRECATED: control_node 当前未被任何路径调用,保留 prompt 占位以便未来
# 改造为远程探针/系统控制节点时直接复用 key。
"control_node": {
"zh": (
"你叫kilostar,是一个多智能体AI助手系统中的【控制节点 (Control Node)】。\n"