feat(dag): node timeout escalation — signal, adjudication, cap backstop - #178
Merged
Conversation
…fig-repo templates (#173) dev → main 正式版。全部 PR checks pass(第二次 run);第一次 dev-push run 的 HttpAPI effect 模式 CI 超时(偶发,非代码问题)。
fix: dev → main — 快速双击 ESC 可靠中断 + DAG extend 跨 condition-skipped 依赖 reopen
- 超时信号:节点超时不杀子会话;持久化 NodeTimeoutEscalated 与 timeout_extensions,wake 主 agent 裁决(report_to_parent=false 的升级节点同样送达,F11) - 延长路径:replan 携带新 worker_config.timeout_ms → 重算绝对 deadline;§3.7 变更门控 + A1 cap gate(deadline 已过期或 escalation_pending 才放行,防循环改值绕过上限);F2 省略 timeout_ms 不隐式缩短既有延长 - 上限兜底:timeout_extensions 达上限 → 强制 cancel + nodeFailed(timeout);计数 per-attempt 累计(NodeStarted/Restarted 清零),配合 maxNodeReplanAttempts 构成全生命周期上界(§6:COUNT-based,默认 10min 下单次尝试 ≈3.5h) - 失败安全:N1 extend 写入前置(写失败/dead/block 保留旧 watcher,监督不缺席);D1 per-node catchCause(单点 extend 失败不中断 sweep/spawnReady/checkCompletion);written 行数可观测(guard 拒绝 = 0 行) - 崩溃恢复:orphaned pending/adoption 恢复(Effect.ensuring 释放槽位);deadline watcher 自续轮询(S1/F5/F8) - escalation_pending 列 + 两个独立 migration(按 id 至多执行一次);summary/TUI/httpapi 透出 escalatedNodes(F10 指示) - 测试:test/dag 359 pass(含 N1/D1/A1/F1B 失败路径与 cap 回归) - chore: oxlint warning ratchet 4734 → 4831;其中 4826 为本批 DAG 提交态实测(新增测试沿用既有 as-never 惯例的 no-unsafe-type-assertion),另 5 为工作树内同批未入本 PR 的非 DAG 改动贡献
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
批次内容
DAG 节点超时升级引擎(经 5 轮双轴深度 review,阻断项全部闭合)。
超时信号
NodeTimeoutEscalated事件与timeout_extensions计数,wake 主 agent 裁决report_to_parent=false的升级节点同样送达(F11:升级 wake 是 cap 的唯一力量)延长路径
worker_config.timeout_ms→ 重算绝对 deadline(自裁决时刻)上限兜底
timeout_extensions达上限 → 强制 cancel + nodeFailed("timeout")maxNodeReplanAttempts构成全生命周期上界;上界为 COUNT-based(默认 10min 下单次尝试 ≈3.5h,全生命周期 ≈21h)失败安全(review 验证过的不变量)
崩溃恢复:orphaned pending/adoption 恢复(Effect.ensuring 保证槽位释放);deadline watcher 自续轮询(S1/F5/F8)
Schema/透出:
escalation_pending列 + 两个独立 migration(按 id 至多执行一次);summary/TUI/httpapi 透出escalatedNodes(F10 指示);SDK types.gen.ts 已再生成测试
packages/opencode:bun test test/dag/359 pass(含 N1/D1/A1/F1B 失败路径与 cap 回归;N1/D1 回归测试均经过「临时撤掉修复 → 测试失败」的可信验证)packages/core: 1163 测,仅 2 个既有环境失败(Watcher/.git、ProjectCopy worktree),与本批无关chore 说明
oxlint warning ratchet 4734 → 4831:其中 4826 为本批 DAG 提交态实测(新增测试沿用既有
as never惯例产生的no-unsafe-type-assertion警告,既有 committed DAG 测试同样大量存在),另 5 为工作树内同批未入本 PR 的非 DAG 改动贡献。不在本 PR(留在工作树,后续 PR)
已知遗留(不阻断,review 记录在案)
escalation_pending终态不清理:同一状态机问题,建议后续 change 整体处理