Skip to content

feat(generation): add validated SSE task adapter - #110

Open
xyh202131 wants to merge 1 commit into
1024XEngineer:mainfrom
xyh202131:feat/generation-sse-adapter
Open

feat(generation): add validated SSE task adapter#110
xyh202131 wants to merge 1 commit into
1024XEngineer:mainfrom
xyh202131:feat/generation-sse-adapter

Conversation

@xyh202131

Copy link
Copy Markdown

Summary

  • implement Generation create, query and SSE subscription behind GenerationApis
  • inject user identity, request transport, stream transport and project image-size resolution
  • request exactly 4 character candidates, 1 action first frame and 16 complete animation frames
  • validate task identity, input payload, action type, terminal result, contiguous frame indexes and status/error invariants
  • close SSE on terminal or fatal payload errors, require an error handler, and keep native EventSource reconnect behavior without polling

Scope

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

  • changed-file format check: passed
  • lint: passed
  • typecheck: passed
  • tests: 4 files, 14 tests passed
  • production build: passed
  • repository-wide format:check remains blocked by 41 pre-existing files on main; this PR keeps the generation change minimal

Refs #78

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 4, 2026 8:07am

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 carries duration_ms and the frontend Frame model can store durationMs. Once this adapter maps the task into GenerationResult, 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',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant