feat(workflow-controller): add resumable workflow coordination - #107
feat(workflow-controller): add resumable workflow coordination#107xyh202131 wants to merge 10 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| } | ||
|
|
||
| const taskIds = requireStep(run, 'first-frame').candidateTaskIds | ||
| const terminals = await Promise.all( |
There was a problem hiding this comment.
High: waitForTerminal subscribes only after it has already observed a non-terminal snapshot. If the generation completes in the gap between get() and subscribe(), that terminal event is missed and the promise can hang forever, which leaves start*/resume* calls stuck.
| nextType: WorkflowStepType, | ||
| updatedAt: string, | ||
| ): WorkflowRun { | ||
| return editCurrentRevision(run, updatedAt, (revision) => { |
There was a problem hiding this comment.
High: this helper advances the current revision without checking whether the run was interrupted meanwhile. interruptRun() only flips the run status, so an in-flight generation that finishes later can still move an interrupted workflow forward behind the user's back.
| if (current.status !== expectedRevisionStatus) return false | ||
| if (revisions.slice(0, -1).some((revision) => revision.status === 'active')) return false | ||
|
|
||
| // 运行中/已中断保留唯一当前步骤;终态不得继续挂着 active 步骤。 |
There was a problem hiding this comment.
Medium: the terminal-state check only looks for active steps. A completed run can still contain failed steps and pass validation, so corrupted or partially failed history can be hydrated/saved as if it were valid.
变更说明
实现 pages 与 WorkflowRun Entity 之间的
WorkflowController协调层:页面只发出创作命令并接收阶段快照,状态推进、任务恢复和审核读取继续由 WorkflowRun Service 负责。本 PR 包含
resume()去重。边界说明
frontend/src/features/workflow-controller/下 3 个文件。main,feat(workflow-run): implement resumable generation orchestration #86 合入前文件列表会暂时显示 WorkflowRun 依赖文件;feat(workflow-run): implement resumable generation orchestration #86 合入后这些依赖差异会自动消失。验证
git diff --check:通过Depends on #86
Closes #106