zcbot/web
caoqianming 1646205364 fix(scheduler): 定时任务超时被掐断时记 error 而非误吞成 ok(bump 0.32.2)
实测 bug:isolated 定时 job 跑满 timeout_seconds 被协作式 cancel 后,
_run_agent_bg 对 ok/cancelled 都把 run_status 收回 idle(DB 不可区分),
而 _execute_scheduled_job 收尾只判 run_status=="error",于是超时中断被落成
last_status="ok" —— 掩盖"跑到一半没写 sections/没推送",且不计连续失败、
不触发兜底。复盘 job e621c8a6「每日水泥科研简报」:timeout=600s,task
创建→last_run_at 正好 600.0s,agent 停在"按期刊打印 38 篇摘要"(还在取数)。

修:超时分支置 timed_out 标志,run 收尾后若 timed_out → record_result(
status="error", 半成品不投递 notify)并直接返回。复用既有 error 语义(计入
consecutive_failures、到阈值自动停用、前端 crons 显示「上次失败」)。不动
_run_agent_bg 的 idle-on-cancel 共享语义(HTTP cancel/drain 也依赖)。

配套:PROGRESS/RUN 故障兜底各加一条;诊断脚本 scripts/diag_sched_e621.py
(dump 输出 scripts/_*.txt 入 gitignore)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 14:35:40 +08:00
..
static feat(web): 消息框支持拖拽文件 + 修多次粘贴互相顶掉(bump 0.31.3) 2026-06-26 14:38:58 +08:00
__init__.py core(§7 Phase G G1): Web UI 脚手架 + cli.py web 子命令 2026-05-14 13:37:54 +08:00
admin.py feat: per-account 模型访问控制(档位制,复用 plan 列)(bump 0.31.0) 2026-06-26 14:11:22 +08:00
app.py fix(scheduler): 定时任务超时被掐断时记 error 而非误吞成 ok(bump 0.32.2) 2026-06-29 14:35:40 +08:00
auth.py feat(auth): 平台登录注入 name/user_name + 监控页/dev 顶栏用户名展示 + bump 0.26.1 2026-06-25 09:31:32 +08:00
broker.py feat(ops): 并发/线程池轻量监控 + 接管默认 executor 2026-06-11 11:09:44 +08:00
pptx_render.py feat(preview): pptx 在线预览 —— LibreOffice→PDF + 复用 PDF iframe(DESIGN §8.3 Stage 1) 2026-06-09 13:04:02 +08:00
sinks.py core(0004): 删 runs / usage_events 表 + cancel/SSE 改 task-level 2026-05-18 11:05:35 +08:00
static_files.py Disable static asset caching 2026-06-08 09:16:31 +08:00