feat(workflow-controller): add resumable workflow coordination - #107
feat(workflow-controller): add resumable workflow coordination#107xyh202131 wants to merge 33 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.
…ore-clean # Conflicts: # README.md # frontend/README.md
…ore-clean # Conflicts: # frontend/src/entities/index.ts
…ller-coordinator # Conflicts: # frontend/src/entities/workflow-run/service/workflow-run-service.test.ts # frontend/src/entities/workflow-run/service/workflow-run-service.ts # frontend/src/entities/workflow-run/store/workflow-run-store.test.ts # frontend/src/features/workflow-controller/index.ts
…oller-coordinator
变更说明
实现页面与 WorkflowRun Entity 之间的
WorkflowController协调层。页面只发送创作命令并接收可渲染阶段,WorkflowRun 继续负责状态迁移、GenerationTask 恢复、Revision 重做与动作写回。本 PR 包含
resume()请求。边界说明
list、subscribe或subscribeAll;页面操作本身知道状态何时改变。验证
git diff --check:通过Depends on #86
Closes #106