feat(generation): add validated SSE task adapter - #110
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Review summary: two issues stand out.
Findings without inline locations
frontend/src/entities/generation/index.ts:102: The complete-animation result type only preserves URLs, but the backend action frame DTO already carriesduration_msand the frontendFramemodel can storedurationMs. Once this adapter maps the task intoGenerationResult, that timing data is gone and downstream character writes will have to invent defaults.
| ? references(input) | ||
| : input.referenceMedia.map(String).filter((url) => url.trim() !== '') | ||
| return post( | ||
| '/generation/action', |
There was a problem hiding this comment.
This changes first_frame to /generation/action, which may be the intended runtime contract, but it now disagrees with the repo-facing API contract in frontend/API_CONTRACT.md that still documents /generation/image here. Please update that doc in the same change set, otherwise callers will implement the wrong endpoint.
实测反馈:契约对得上,但终态不关流会无限重连;另外目前零 UI 消费者在集成分支( 1. 契约是对的,两处可以放心
2. 终态之后 EventSource 会每 3 秒重连一次,需要显式 close服务端发完终态事件就关流,但响应里带了 也就是说:任务早就结束了,前端还在每 3 秒打一次请求,且业务回调会被重复触发。 修法二选一(前者更稳):
3. 目前全仓没有调用方搜 |
Summary
GenerationApisScope
Frontend only. The backend SSE endpoint is not claimed as implemented here. No page, WorkflowRun, Controller, backend, database, log or build artifact is included.
Verification
format:checkremains blocked by 41 pre-existing files onmain; this PR keeps the generation change minimalRefs #78