auto-sync: 2026-06-07 01:35:53
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions

This commit is contained in:
cfdaily
2026-06-07 01:35:53 +08:00
parent 8f796a1c26
commit 0d7425b88c
36 changed files with 15679 additions and 144 deletions
@@ -205,15 +205,10 @@ if cls.get("cooldown_seconds"):
**方案**:在 `_do_retry` 开始时设 cooldowncooldown 期间 `asyncio.sleep`,然后继续 spawn。这样不需要改 counter 逻辑。
### 3.7 stderr 记录增强 — 已实施(2026-06-05
### 3.7 stderr 记录增强 — 暂缓
非正常完成(outcome ≠ completed)时,在 task_attempts metadata 中追加:
- `stderr_preview`stderr 末尾 1000 字符(tail,关键错误在末尾)
- `exit_signal`:信号名映射(SIGINT/SIGKILL/SIGTERM/SIGFPE/SIGSEGV),仅 exit_code > 128 时
不改表结构,不存文件。`log_path` 字段保留但未启用。
评审:司马懿通过。
stderr_preview 和 exit_signal 写 metadata 的方案暂缓,本轮不实施。
已有 metadata 记录 fallback_count、api_retry_count、retry_count 等计数器。
## 4. Registry 清理 — 最终决策:逻辑删除 + 归档,不做物理删除
@@ -312,3 +307,36 @@ if cls.get("cooldown_seconds"):
- 新增 §3.6 cooldown 参数汇总
- 新增 §4 Registry 清理
- 新增 §5 并发控制一致性检查(TODO 标记)
## 9. v2.1 修订:失败处理一致性修复(2026-06-06)
> 审计发现设计文档描述的 failed 处理在代码中有 3 处 gap,已修复并通过司马懿评审。
### 9.1 发现的问题
| BUG | 设计要求 | 代码实际 | 影响 |
|-----|---------|---------|------|
| BUG-1 | A6 auth_failed / A11 agent_error → 标 failed + 原因写黑板 | 只设 cooldown 300s,任务留 working 等 ticker 30 分钟 | 不可恢复错误白等 30 分钟 |
| BUG-2 | Mail 幻觉门控无回复 → 标 failed(no_reply_found) | 留 working 等 ticker recheck | Agent 未回复 Mail 卡 30 分钟 |
| BUG-3 | 所有设计只描述到标 failed 为止 | 标完 failed 无任何通知 | failed 任务无人关注 |
### 9.2 修复内容
**F1: auth_failed + agent_error → 立刻标 failed**spawner.py:855-860
`_handle_exit()` "其他"分支中,cooldown 之后、`_do_on_complete_async` 之前,新增不可恢复 outcome 立刻标 failed 逻辑。
**F2: 所有 failed → comment @pangtong-fujunshi**spawner.py:1456-1470
`_mark_task()` 中 conn.close() 之后,检查 `status == "failed"` 时通过 Blackboard comment + mention_queue 通知庞统。不走 Mail,走黑板 comment + mention 标准流程。
**F3: Mail 幻觉门控失败 → 立刻标 failed**dispatcher.py:679-707
`_mail_auto_complete()` 中,无回复时用与标 done 同样的重试模式(3 次尝试)标 failed。不 retryAgent turn 已结束,同样 prompt 大概率同样结果)。
### 9.3 不改的
- compact 检测:Fix-1 session jsonl 扫描是主要防线,Phase 2 无上限 skip + Monitor B2 最多 31.5 分钟,合理
- compact_failed (有JSON+stderr):暂缓(08 §1.1 已标注)
- agent_error 不改为 retry:未知错误 retry 无意义
- api_error:当前推回 pending + cooldown 是对的