Repository navigation
Conversation
Zpc001
left a comment
There was a problem hiding this comment.
Reviewed. The settlement is correct and well-scoped: runWorkspaceNodeUnknown is generalized to both run kinds through 0039's XOR binding without changing its judgement polarity, the window is threaded from the scheduler rather than introducing a second limit, node_unavailable reuses the published operation failure code, and the four tests cover the claimed gaps (heartbeat-past-window, force-stop sandbox-gone, within-window hold, unconfigured-window hold, late-result-kept). Docs mirror in both languages and the ADR status / net changed files are stated correctly. Approving.
|
冲突已解决,head 更新为 两处冲突及处理:
本地门禁: 因为合并提交改变了与 cloud#96 的交互,@Zpc001 请再 review 一次这个合并结果。 |
…both run kinds runWorkspaceNodeUnknown only ever read its window argument, so it does not need the Store receiver, and the binding it tests can cover both kinds of run: a Workspace is tied to its run by issue_run_id or by workflow_run_id, which 0039 makes mutually exclusive, so one comparison answers "is this Workspace bound to this run?" without the caller having to say which kind it holds. Nothing about the judgement changes — its polarity, its database clock and its fail-closed window stay exactly as documented — but it is now the one place the heartbeat evidence behind "the Node is unreachable" is read, so the workflow scheduler's session settlement can ask it instead of defining a second one. Co-Authored-By: Claude Code <noreply@anthropic.com>
A workflow run's agent node is committed `running` while its session executes, and the pass holds it until the Node reports. When the Node can no longer report — its heartbeat has been stale past the deployment's window, or its sandbox is gone, which is the state a force stop leaves behind — holding the run waits forever for evidence that cannot arrive: the run stays `running` and its Workspace is never released. The settlement now asks the judgement the IssueRun release paths already make (runWorkspaceNodeUnknown) with the same window, so "the Node is unreachable" has one definition across run kinds, and fails the node under Cloud's own code `node_unavailable` rather than borrowing a Node-reported session end reason: nothing reported anything here, and the two must stay distinguishable. No committed result exists for the node, so it is never recorded succeeded (invariant 5), and the run follows the existing failure propagation into its terminal state and Workspace deletion. The window is threaded from the pass (Store.DeliveryUnreachableAfter) instead of introducing a second limit; an unconfigured window fails closed and holds the session, exactly as it does for D5 and D8. Tests: both shapes of a gone Node, silence inside the window holding, an unconfigured window holding, and a late real result staying on the execution row without rewriting the terminal run. Co-Authored-By: Claude Code <noreply@anthropic.com>
…ht sessions The scheduling section named the reasons a session fails to start; add the one it fails with when its Node is gone, including the window it reads and the fact that `node_unavailable` is Cloud's own diagnosis rather than a session end reason a Node reported. The configuration table now says `delivery_unreachable_after` is also the "is the Node still there" window, since a deployment that sets it sets both. Co-Authored-By: Claude Code <noreply@anthropic.com>
4ee609d to
db0cddd
Compare
|
按 owner 要求改为 rebase:分支现在基于最新
两处冲突( 门禁(rebase 后的新 head,真实 PostgreSQL):
@Zpc001 请按新 head |
Zpc001
left a comment
There was a problem hiding this comment.
Re-reviewed the rebased head (db0cddd, on upstream/main 4718aba with #96 and #99). The composition is correct: the dispatched-but-not-terminal branch first asks runWorkspaceNodeUnknown and settles node_unavailable when the Node is gone (S1), otherwise delegates to workflowSessionEndRequest (the #96 single-turn path). unreachableAfter threads through AdvanceWorkflowRunsOnce -> advanceWorkflowRun -> workflowAgentSessionOutcome with all call sites updated. The four S1 tests are intact and the #96 end-path tests still pass. CI is green. Approving.
zhangshilong123
left a comment
There was a problem hiding this comment.
复审通过(head db0cddd,基于 upstream/main 4718aba,MERGEABLE/CLEAN,CI check 通过)。
核对:
runWorkspaceNodeUnknown转自由函数、绑定条件泛化为issue_run_id OR workflow_run_id,0039 的 XOR 约束保证互斥,D5/D8 与调度器问同一份 SQL,判断本体未改。workflowAgentSessionOutcome组合顺序正确:先问共享的runWorkspaceNodeUnknown,Node 不可达 →node_unavailable结算失败并结束运行;可达 → 委托 #96 的workflowSessionEndRequest单回合结束路径。DeliveryUnreachableAfter从AdvanceWorkflowRunsOnce→advanceWorkflowRun→workflowAgentSessionOutcome穿透一致,调用点全部同步。- 文档中英文同步,配置说明改为「判定窗口同时用于会话结算」。
- 4 个 S1 用例覆盖缺口(超窗/沙箱消失、窗口内保持、未配置保持、结算后迟到结果保留)。
无迁移。合并仍由 owner 决定。
本 PR 做什么
工作流运行的 agent 节点在会话执行期间以
running提交,调度器一直等 Node 上报才结算。Node 再也报不出消息时——心跳超过部署的窗口,或者沙箱连同其上的 Node 一起消失(强制停止留下的正是这个状态)——这个等待永远不会结束:运行停在running,它的 Workspace 也永远不会被释放。本 PR 把这种"已派发、无结果"收敛成有界结算:
runWorkspaceNodeUnknown从 Store 方法改为自由函数,绑定条件按运行类型泛化(issue_run_id或workflow_run_id,0039 的 XOR 保证二者互斥),IssueRun 的 D5/D8 与工作流调度器问的是同一份 SQL。判断本身(极性、数据库时钟、未配置窗口按失败关闭)一字未改。Store.DeliveryUnreachableAfter),不新增第二个上限——两个 pass 不会对"同一个 Node 还在吗"给出不同答案。未配置(≤0)时会话保持等待而不是被误判。node_unavailable结算失败,运行走既有的失败传播进入终态并声明 Workspace 删除。该节点没有已提交结果,因此永不被记为成功(不变量 5)。刻意不用 Node 上报的会话结束原因(interrupted、agent_failed):这里没有任何东西上报过,Cloud 的判断必须和 Node 的报告可区分。node_executions.result上(那是"实际跑过什么"的唯一记录),但终态运行不会被它改写。测试
TestWorkflowSessionNodeGoneSettlesTheNodeFailednode_unavailable失败,Workspace 删除已声明TestWorkflowSessionNodeSilenceWithinWindowHoldsrunning,越过窗口才结算——判据是可达性不是时长TestWorkflowSessionUnconfiguredWindowHoldsTheNodeTestWorkflowSessionResultAfterTheNodeSettledIsKept把结算逻辑临时关掉重跑,前三个用例会以"运行停在
running"失败——它们确实覆盖这个缺口。ADR 状态
实现
decisions/cloud/workflow/0-cloud-side-scheduler-owns-workflow-execution.md(approved)D1 条件② 与 D4 的一部分。该 ADR 的取消、恢复与成果资源收尾由 ora-space/circus#75 的后续切片承接,因此本 PR 不改 ADR 状态(保持approved)。specs 侧test-cases/cloud/workflow/scheduler-serialism-and-recovery.md证据表的更新("无已提交结果的节点不进入成功状态"一节)在合并后单独提 PR,引用本 PR 的合并结果。门禁
本地(Windows):
task format:check、task lint(0 issues)、task build全绿;go test ./internal/core/全绿(57s)。go test ./...另有cmd/devsetup、internal/gateway、internal/gitpreset、internal/gitserver、integration的失败,逐条与基线 commit1b0d408一致(缺git http-backend、Windows 文件权限位等环境原因),与本改动无关。净改动文件
Refs ora-space/circus#242
🤖 Generated with Claude Code