Skip to content

fix: type video generation results for boolean async options - #309

Open
1828703450qqcom-ux wants to merge 1 commit into
MiniMax-AI:mainfrom
1828703450qqcom-ux:fix/sdk-video-boolean-async-result
Open

1828703450qqcom-ux wants to merge 1 commit into
MiniMax-AI:mainfrom
1828703450qqcom-ux:fix/sdk-video-boolean-async-result

Conversation

@1828703450qqcom-ux

@1828703450qqcom-ux 1828703450qqcom-ux commented Nov 29, 2026 •

Copy link
Copy Markdown

Problem

VideoSDK.generate() returns a submission with taskId when async mode is enabled. A literal true already inferred that shape, but a boolean from runtime configuration resolved to the synchronous-only overload. Callers could therefore use completed-task fields even when the SDK actually returned a submission.

Change

Preserve narrow types for literal true, literal false, and omitted async. Calls with a widened boolean now return the union of submission and synchronous response shapes.

Verification

  • The SDK regression passes a widened boolean and checks the returned task ID after narrowing. TypeScript reports TS2322 against the original overload.
  • 53 focused mocked video tests, type checking, production build, and CLI startup passed. Lint completed with an existing warning in the speech SDK test.
  • Two independent reviews verified the inferred types and found no blocking issues. No live generation was needed.

Codex assisted with the investigation, implementation, and verification.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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