zcbot/core
caoqianming bf41631437 core(run cancel): POST /runs/{rid}/cancel + AgentLoop 协作式 cancel + dev SPA stop 按钮
落地 DESIGN §7.2 原标"待"的 cancel 路由 — 等待回复 / LLM 操作时也能中断。

- broker 加 request_cancel / is_cancelled / clear_cancel(per-run threading.Event)
- AgentLoop 加 cancel_check 回调,每轮 LLM 前 + tool_calls 之间 poll;命中给
  未执行 tool_call 补 [cancelled by user] tool result 保 LiteLLM 协议,emit
  cancelled event
- 单活 gate + 启动 reaper 扩到 running | cancelling
- BG 装 cancel_check + 终态判 cancelled/ok + finally clear flag
- dev SPA stop 按钮 + cancelled badge + fetchSse try/finally 失败路径复原 UI

LLM 同步 call 本身不可中断,最坏等当前一轮跑完(通常几十秒)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 08:42:45 +08:00
..
storage core(0003): name + working_dir + skill schema 重构 + per-user .memory 2026-05-17 19:15:37 +08:00
__init__.py Initial import: zcbot personal task agent 2026-05-06 11:02:59 +08:00
capabilities.py Initial import: zcbot personal task agent 2026-05-06 11:02:59 +08:00
export_docx.py core(0003): name + working_dir + skill schema 重构 + per-user .memory 2026-05-17 19:15:37 +08:00
llm.py core(§7 D + D'): /v1 JSON API + PLATFORM_KEY→JWT auth + dev SPA 2026-05-15 16:14:25 +08:00
loop.py core(run cancel): POST /runs/{rid}/cancel + AgentLoop 协作式 cancel + dev SPA stop 按钮 2026-05-18 08:42:45 +08:00
memory.py core(0003): name + working_dir + skill schema 重构 + per-user .memory 2026-05-17 19:15:37 +08:00
paths.py core(0003): name + working_dir + skill schema 重构 + per-user .memory 2026-05-17 19:15:37 +08:00
probe.py Phase 4 + 6: capability probe + task 概念 / state.json 2026-05-06 16:21:17 +08:00
session.py core(0003): name + working_dir + skill schema 重构 + per-user .memory 2026-05-17 19:15:37 +08:00
sinks.py core: loop 事件流化 (sink 接口, §7 A 阶段) 2026-05-11 14:59:32 +08:00
skills.py Initial import: zcbot personal task agent 2026-05-06 11:02:59 +08:00
task.py core(0003): name + working_dir + skill schema 重构 + per-user .memory 2026-05-17 19:15:37 +08:00
ui.py core/ui: 抽出语义化 console 主题, 调用方去硬编码颜色 2026-05-07 16:10:11 +08:00