delegate_task/cancel_delegate_task 前台工具 + 任务登记表 #55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#52 [PRD] arise 深挖任务委托(Deep Task Delegation)落地
What to build
RuntimeLoop 新增两个前台核心工具,让主模型能够登记一个深挖任务并立即应声、继续当轮对话,任务在后台异步跑(用 #54 的执行核)。用户可以用自然语言让模型调用取消工具真中断一个正在跑的任务。本 ticket 交付这两个工具的完整前台行为(登记、应声、去重、取消、fail-closed),暂不接任务完成后的送回(那是后续任务完成送回闭环 ticket)。
Acceptance criteria
delegate_task(description)(同note_pending_intent/search_memory先例,不经工具港):当轮调用即登记一个后台任务(进程内 chat_id/task_id→运行中任务句柄的内存字典,同_pending_flushes/_pending_followup_checks先例,不落盘),随即以asyncio方式启动 #54 的子智能体循环,不阻塞当轮工具循环,不计入本轮run_limit/MAX_SENDS_PER_TURNdelegate_task后通常紧跟一次send_message应声,当轮随后自然结束(有RuntimeLoop.run()脚本化对话测试断言应声内容)delegate_task直接返回"已有任务在跑"的可读结果给模型,不新起第二个任务(有测试覆盖去重路径)cancel_delegate_task(task_id?):找到对应任务仍在跑时,真中断底层asyncio任务(有测试断言取消后任务确实被中断,不是仅标记状态);找不到对应任务时视为无操作(fail-closed,不报错阻断对话)delegate_task/cancel_delegate_task两个新 handler 直接喂RuntimeLoop.run()脚本化对话断言效果(任务登记表状态、应声内容、重复请求提示、找不到任务时的 fail-closed 行为),同现有_handle_note_pending_intent等工具处理器的既有测试模式Blocked by