refactor(quick-start): align with six-node workflow controller - #215
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Found two correctness issues in paginated character/workflow recovery paths; both can make an otherwise valid Quick Start run fail or create a duplicate run.
Local test execution was unavailable because the checked-out workspace has no executable Vitest/TypeScript binaries.
| const run = controller.getWorkflow() | ||
| const firstFrame = latestActionFirstFrame(run) | ||
| if (!firstFrame || firstFrame.type !== 'action-first-frame') return null | ||
| const page = await characterApis.listByProject(run.projectId) |
There was a problem hiding this comment.
[P1] Page through character records when resolving the asset
listByProject(run.projectId) uses the API default page size and only examines that first page. Once a project has more characters than that default, a valid character bound to this run can be omitted, so approveReview() reports WorkflowRun 缺少角色或造型绑定 and publishing fails even though the asset exists. Please paginate until total is covered (or add a server-side lookup by workflowRunId).
| if (!workflowRunApis.listByProject) { | ||
| throw new Error('工作流列表服务尚未配置,不能为现有角色增加动作') | ||
| } | ||
| const listed = await workflowRunApis.listByProject(character.projectId, { |
There was a problem hiding this comment.
[P1] Do not cap workflow lookup at the first 100 runs
startAction() searches only this single page for the character's existing run. For a project with more than 100 workflow runs, the matching run may be on a later page; the code then creates a second run for the same character instead of appending to the existing one. That can duplicate the workflow and later make character resolution ambiguous. Please paginate all pages or use a backend query keyed by characterId/workflowRunId.
| return unauthorizedRecoveryProviders.at(-1) | ||
| } | ||
|
|
||
| /** 供不能使用 ApiClient 的流式或原始响应适配器复用会话恢复。 */ |
There was a problem hiding this comment.
Nit: 不是这个 PR 的问题,不过顺便提一嘴,流式请求也是可以(且应该)走 ApiClient 的,对 ApiClient 进行正确的抽象就行
| return stop | ||
| } | ||
|
|
||
| function createSession(controller: WorkflowController): QuickStartSession { |
There was a problem hiding this comment.
是这样,我们后面会把概念给简单一点,现在主要是我们和后端对的不是很好,然后导致对概念的不同。
重新送审说明
main仍为原 Quick Start 变更:12 个文件,新增 3223 行、删除 14 行。本次更新
验证
Closes #95 的后续重新送审。