Repository navigation
feat: move Kling and Grok video onto the job contract - #350
Merged
Merged
Conversation
Kling and Grok now implement `VideoGenerator` and pass the contract suite;
their older methods wrap it, so CLI callers are unchanged.
Kling
- Its service codes decide the error kind (1102 "resource pack exhausted"
arrives as HTTP 429 and is quota, not a rate limit), including codes
inside a 200 body.
- The job handle records the task type, so polling no longer needs it
passed in, and `outputId` carries the video ID that extension needs.
- Extension is a continuation (`from: {kind: "extend"}`).
Grok
- Edit and extend are continuations over xAI's /videos/edits and
/videos/extensions. Only classic grok-imagine-video can do them
(probed live: 1.5 and 1.5-lite answer 400), so continuations default to
it and refuse other models before sending.
- An expired job is a timeout; cancel stays out of the contract because
xAI documents no cancel endpoint.
Shared
- providerRequest classifies before retrying, so a 429 that means exhausted
credits is not retried, and takes a per-provider `classify` hook.
- Numeric error codes are kept; "risk control" and "content security" read
as moderation (Kling's wording).
Claude-Session: https://claude.ai/code/session_011S1BLTaFctZNQzGERpkCuA
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 4, 2026
This branch was successfully deployed
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.
Second PR of the provider interface work (after #349).
Kling
quotaand is not retried. Codes inside a 200 body are handled too.text2video,image2video, orvideo-extend), so polling no longer needs it passed in.VideoJobState.outputIdcarries the Klingvideo_idthat extension needs.from: {kind: "extend"}. Edit throwsunsupported. There is no cancel method, since Kling has no cancel API.Grok
/videos/editsand/videos/extensions, which are new capabilities.grok-imagine-videocan do them. Probed live:-1.5and-1.5-liteanswer 400 "Video extension is not supported for this model". Continuations default to classic and refuse other models before sending. The catalog note andxai.mdrecord this.timeout. Cancel stays out of the contract because xAI documents no cancel endpoint; the legacy best-effort method is unchanged.Shared
providerRequestclassifies before deciding to retry, so a 429 meaning "out of credits" is not retried. It also takes a per-providerclassifyhook.Verification
video_id. They also cover Grok edit and extend request shapes, refusing a continuation on the wrong model, and expiry.pnpm build,lint,typecheck, tests (providers 193, CLI 1215, MCP 73), pre-push gate.vibe generate video -p kling --duration 3: a 3.04 s clip.-p grok --grok-model lite --duration 2: a 2.04 s clip.invalid-requesterrors.https://claude.ai/code/session_011S1BLTaFctZNQzGERpkCuA