Skip to content

feat: run CLI video executors and job records on the job contract - #352

Merged
kiyeonjeon21 merged 2 commits into
mainfrom
feat/cli-video-job-layer
Oct 4, 2026
Merged

kiyeonjeon21 merged 2 commits into
mainfrom
feat/cli-video-job-layer

Conversation

@kiyeonjeon21

Copy link
Copy Markdown
Contributor

Fourth PR of the provider interface work (step 3a of the plan): the CLI's video layer now speaks only the job contract.

What changes

  • One way to open a provider: createVideoGenerator(provider, key) in ai-providers.
    • A thin VeoGenerator adapter means Veo needs no CLI branch until it is removed after 2026-10-22.
    • VideoGenerator.imageInput (url | data-uri | either) tells the CLI whether to upload or inline a local frame.
  • Executors without provider branches: executeVideoGenerate, Status, Cancel, and Extend contain no provider-name branches; ai-video.ts drops from 772 lines to about 330. They return the job handle and the provider error kind.
  • Job records store the handle (providerJob), so vibe status job polls exactly what was submitted. Seedance and Omni jobs, which had no live status, are now refreshable.
  • Builds record, then wait: a build records a video job as soon as the provider accepts it, then waits inline for every provider.
    • The default Seedance flow is unchanged.
    • Runway, Kling, and Grok builds now finish in one run instead of stopping at "pending".
    • A crash or a wait that runs out leaves a job vibe status job can still download, and a timeout reads as "still running".
    • The likeness fallback now checks errorKind, with the wording match kept as a backstop.
  • video-extend and video-cancel: extend works on Kling, Grok, Omni, and Veo by the task ID the generation returned; Kling used to need its internal video ID, which no command printed. Cancel works on Runway, Seedance, and Omni; Kling and Grok have no cancel API and are refused with a clear message.
  • providerFailure() picks the CLI error envelope (auth, usage, or retryable API) from the error kind and carries errorKind in JSON errors.

Bugs fixed on the way

  • Kling job never resolved: a Kling image-to-video job started without waiting was polled as text-to-video.
  • generate_video defaults: without a provider it defaulted to Kling instead of the configured provider its description promised, and it ignored the endImage it advertises.
  • Dead suggestion: job records and video-extend suggested vibe generate video-status, which no longer exists (neither does music-status).
  • Seedance cancel status: a cancelled Seedance job read as failed; fal reports error_type: "client_cancelled".
  • Dead code: the unused _shared/video-providers.ts retry helpers are removed.

Verification

  • New tests:
    • Executors over the fake network: default provider, Kling URL upload with the handle, stored-handle polling, cancel refusal and Runway cancel, extend by task ID, wait timeout as running, likeness kind.
    • Generator registry and bare-ID lookups.
    • The build records the job with its handle and marks it completed.
    • fal cancelled state.
  • Checks: pnpm build, lint, typecheck, tests (providers 210, CLI 1224, MCP 73), pre-push gate.
  • Live:
    • Kling image-to-video submitted without waiting, recorded, then vibe status job --wait polled the image2video endpoint from the handle and downloaded a 3.04 s clip.
    • A Seedance job submitted and cancelled now reads as cancelled.
    • vibe generate video-extend <grok task> -p grok: 2 s + 2 s = 4.04 s.
    • About $0.35.

Next (3b)

Move the generate video command itself (913 lines with its own provider branches) and fill-gaps onto executeVideoGenerate.

https://claude.ai/code/session_011S1BLTaFctZNQzGERpkCuA

The CLI's video executors branched on provider names (35 provider calls in
ai-video.ts alone). They now open any provider through one registry and
speak only the video job contract.

- `createVideoGenerator(provider, key)` in ai-providers, plus a thin Veo
  adapter so Veo needs no branch until it is removed after 2026-10-22.
- `VideoGenerator.imageInput` says whether a provider takes image URLs,
  data URIs, or either; the CLI uploads or inlines local frames to match.
- executeVideoGenerate/Status/Cancel/Extend have no provider branches. They
  return the job handle and the provider error kind.
- Job records store the job handle (`providerJob`), so `vibe status job`
  polls exactly what was submitted, and Seedance and Omni jobs are now
  refreshable.
- Builds record a video job the moment the provider accepts it, then wait
  inline for every provider. A crash or a wait that runs out leaves a job
  `vibe status job` can still download; a timeout is "still running", not
  a failure. The likeness fallback checks the error kind.
- `video-extend` works on Kling, Grok, Omni, and Veo by the task ID the
  generation returned; `video-cancel` works on Runway, Seedance, and Omni.
- `providerFailure()` picks the CLI error envelope from the error kind.

Fixes:
- A Kling image-to-video job started without waiting was polled as
  text-to-video, so its status never resolved.
- `generate_video` without a provider defaulted to Kling, not the
  configured provider its description promised; its `endImage` was ignored.
- Job records and video-extend suggested `vibe generate video-status`,
  which no longer exists.
- A cancelled Seedance job read as failed (fal reports `client_cancelled`).
- The unused `_shared/video-providers.ts` retry helpers are removed.

Claude-Session: https://claude.ai/code/session_011S1BLTaFctZNQzGERpkCuA
@vercel

vercel Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
vibeframe Ready Ready Preview Oct 4, 2026 3:00pm UTC

Request Review

`videoImageInput` fetched any http(s) URL to inline it for Omni and Veo.
Through the MCP tool, that let a caller make the CLI read an internal URL
(a cloud metadata endpoint, say) and forward its contents to a provider.
Inline-only providers now take local files or data URIs and refuse URLs
with a usage error, as the old Omni path did.

Also updates the video-extend help assertion in the integration suite.

Claude-Session: https://claude.ai/code/session_011S1BLTaFctZNQzGERpkCuA
@kiyeonjeon21
kiyeonjeon21 merged commit 5685fc1 into main Oct 4, 2026
6 checks passed
@kiyeonjeon21
kiyeonjeon21 deleted the feat/cli-video-job-layer branch October 4, 2026 15:04

This branch was successfully deployed

1 active deployment
Preview — 1c20c811 Deployed Oct 4, 2026 by vercel[bot]
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