fix: harden H3 video SDK and error handling - #214
Merged
Conversation
NianJiuZst
marked this pull request as ready for review
August 1, 2026 08:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
contentwith legacy video fields, or passsubject_referencethat would otherwise be silently droppedvideo/quicktimedata URI MIME typeanycast and add regression coverage across SDK, CLI, polling, API errors, and media handlingWhy
This is a follow-up to #212. The H3 success path worked, but several failure paths were incomplete: an SDK caller could request H3 with legacy
subject_referenceand receive a text-only request, Video V2 HTTP errors were reported with generic exit codes, and failed asynchronous tasks discarded the API's nested error details. Local MOV files were also rejected even though the H3 API supports them.The changes fail closed on ambiguous SDK requests and preserve actionable error context for terminal, agent, and CI callers.
Validation
bun test test/errors/api.test.ts test/polling/poll.test.ts test/video/v2.test.ts test/sdk/video.test.ts test/utils/media.test.ts test/commands/video/generate.test.ts— 62 passedbun test— 444 passedbun run typecheckbun run lint— 0 errors; 1 pre-existing warning intest/sdk/speech.test.tsbun run buildgit diff --checkNo paid/live H3 request was used; API interactions are covered by local mock-server and request-validation tests.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.