Skip to content

feat(video): add Kie AI, Z.AI, and Novita video generation - #160080

Merged
steipete merged 8 commits into
mainfrom
steipete/video-providers-kie-zai-novita
Sep 28, 2026
Merged

steipete merged 8 commits into
mainfrom
steipete/video-providers-kie-zai-novita

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Operators with Kie AI, Z.AI, or Novita accounts can't use them for video_generate, and Runway credentials can't be configured as a models.providers SecretRef (the schema demands a baseUrl for non-overlay providers), so Runway only works through env vars or onboarding.

User Impact

User impact: three more video backends work out of the box, all with text-to-video and image-to-video, including local images:

  • Kie AI (new bundled kie plugin, KIE_API_KEY): 13 Market models across Kling 2.6, Grok Imagine, Wan 2.6, Hailuo 02/2.3 and Seedance 1.5 Pro. Default kie/kling-2.6/text-to-video. Local images are uploaded through Kie's documented base64 upload API.
  • Z.AI (existing zai plugin): zai/cogvideox-3, the only video model Z.AI documents for this API. It uses the plugin's existing international/China base URL choice.
  • Novita (existing novita plugin): wan2.6-t2v/wan2.6-i2v and minimax-hailuo-2.3-t2v/-i2v/-fast-i2v.

In all three, supplying one image with a text-to-video model routes to that family's image-to-video model. models.providers.runway.apiKey and models.providers.kie.apiKey now accept SecretRefs without a baseUrl, the same way fal and vydra already do.

Why This Change Was Made

Each provider extends its existing owner where one exists (zai, novita) and uses only public Plugin SDK HTTP, polling, auth and download helpers. Kie is a new media-only plugin, like runway. Capabilities are declared per model so the runtime drops unsupported overrides instead of sending them. Veo on Kie is left out: its docs are mid-migration between a dedicated API and the Market job API. Novita's Kling, Seedance and Vidu slugs aren't routable today, and its unified /v3/async/video/create rejects documented model names, so those are left out too.

Evidence

Live runs of extensions/video-generation-providers.live.test.ts on 2026-09-28 with real keys and full modes (OPENCLAW_LIVE_VIDEO_GENERATION_FULL_MODES=1), before the branches were combined:

Provider / model generate imageToVideo (local image)
kie kling-2.6/text-to-video 163 s 190 s (base64 upload → i2v route)
zai cogvideox-3 58 s 41 s
novita wan2.6-t2v 74 s 86 s (routed to wan2.6-i2v)
runway gen4.5 (regression) 47 s 51 s

Direct API probes also confirmed the raw contracts: Z.AI submit and async-result polling, Kie jobs/createTask and recordInfo with resultJson, and Novita wan2.6-t2v with task-result. Each returned a real mp4.

On the combined branch: 226 focused tests pass (new provider suites: 34 Kie, 15 Z.AI, 17 Novita, all with mocked HTTP); pnpm tsgo:core, tsgo:extensions and tsgo:extensions:test pass; so do pnpm plugins:inventory:check, pnpm check:assertion-safety --base origin/main (no baseline change), docs format and link checks, pnpm check:workflows, and the offline live-suite run. The schema regression for the runway/kie overlay ids fails before the fix. A Runway test exercises the real SDK auth resolver against a resolved file SecretRef.

Test cost: the new provider files run in milliseconds of assertion time. Local walls are 50–190 s with --maxWorkers=1 on a loaded machine, and over 90% of that is cold transform. CI seconds will be reported once the run exists. Live CI: Kie joins native live video shard B, Z.AI and Novita join shard C, and no runners were added. The KIE_API_KEY CI secret is optional, only for live proof.

Add 13 documented Market video models with automatic text/image routing, local image uploads, body-level API errors, and bounded polling/downloads. Register API-key onboarding and discovery, wire live QA and CI filters, and document provider capabilities.

Validation: 34 mocked Kie cases pass; core/extension types, bundled registration, inventory, docs, workflow, formatting, and assertion-safety checks pass. Independent review found no actionable issues. The new test command took 186.18s including cold compilation. Live provider proof remains with the lead; Veo awaits API contract reconciliation.
…iders

Treat runway and kie as bundled provider overlays so apiKey credentials, including SecretRefs, validate without custom baseUrl or models fields. Keep credential resolution in the existing provider auth owner.

Validation: both SecretRef-only schema cases failed before the fix and pass afterward (28 schema cases). All 12 Runway cases pass, including a generated request using the real SDK resolver with a resolved file SecretRef snapshot. Core/extension type checks and the fresh independent review of both requested commits pass.
Extend the Z.AI plugin with regional async CogVideoX text-to-video and image-to-video generation. Reuse provider auth and HTTP helpers, support local image data URIs, and declare duration, geometry, audio, quality, and frame-rate controls.

Wire registration, live provider selection, release shards, generated inventory, and provider documentation. Mocked provider flows, focused contracts, typechecks, inventory, docs, formatting, workflow checks, lint, and assertion safety passed. Live proof remains with the lead.
Extend the Novita plugin with native Wan 2.6 and Hailuo 2.3 async video routes, automatic family image routing, data URI image inputs, and model-specific capabilities. Default Wan output to silent and validate Hailuo duration/resolution combinations before submission.

Wire registration, live provider selection, release shards, generated inventory, and concise provider documentation. Mocked registered-provider flows, focused contracts, typechecks, inventory, docs, formatting, workflow checks, lint, and assertion safety passed. Live proof remains with the lead.
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete enabled auto-merge (squash) September 28, 2026 03:53
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This maintainer PR changes the dependency graph. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: ccd69aff4bf2678e0debe64d3860aa8931f1b5db
  • Maintainer: @steipete
  • Repository role: admin

These dependency graph changes were made:

  • pnpm-lock.yaml
  • extensions/kie/package.json

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 8:10 AM ET / 12:10 UTC (Revision 5).

ClawSweeper review

What this changes

The branch adds Kie AI, Z.AI, and Novita video generation through plugins, enables credential-only Kie and Runway configuration, and updates provider documentation and live checks.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep this PR open: its provider support is absent from current main and the latest release. Two previously reported credential-redaction defects remain and block merge.

Priority: P2
Reviewed head: ccd69aff4bf2678e0debe64d3860aa8931f1b5db

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Concrete live provider results support the feature, but credential-reflection defects prevent a merge-ready rating.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body reports real keyed generation and local-image runs through the provider plugins, with MP4 results for Kie, Z.AI, and Novita; combined-branch mocked checks are supplemental. The overlay-ID change accepts configuration without changing a stored-data format.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body reports real keyed generation and local-image runs through the provider plugins, with MP4 results for Kie, Z.AI, and Novita; combined-branch mocked checks are supplemental. The overlay-ID change accepts configuration without changing a stored-data format.
Evidence reviewed 9 items Current-main necessity: Current main contains none of the three introduced provider implementations.
Release check: The latest stated release commit also contains none of those provider implementations.
Kie error path: Kie's HTTP error call omits the active request headers; its HTTP-200 message and failed-job message are also thrown directly.
Findings 2 actionable findings [P2] Redact Kie credentials before surfacing provider errors
[P2] Redact Z.AI and Novita polling failure text
Security Needs attention Kie error responses can expose a Bearer key: Kie's HTTP error call lacks request-header redaction, and its body-level failure messages are surfaced directly.
Polling failures can expose provider credentials: Z.AI and Novita return vendor failure text that the shared poller throws without exact-key redaction.

How this fits together

An agent's video request enters OpenClaw's shared video tool, which selects a configured provider plugin. The plugin submits a vendor job, polls for completion, and returns a downloaded video or an error.

flowchart LR
A[Agent video request] --> B[Model selection]
C[Provider credentials] --> D[Provider plugin]
B --> D
D --> E[Vendor video job]
E --> F[Polling and download]
F --> G[Video or error]
Loading

Before merge

  • Redact Kie credentials before surfacing provider errors (P2) - This HTTP error call omits the active request headers, while the same provider also throws HTTP-200 msg and failMsg text directly. If Kie or a proxy reflects the Bearer key, video_generate can surface it. Pass the active headers to HTTP error handling and redact body-level messages before throwing them.
  • Redact Z.AI and Novita polling failure text (P2) - The polling helper throws this returned message verbatim; Novita likewise returns task.reason verbatim. A failed provider response that reflects the active key therefore leaks it through the video error. Redact both callbacks against their active headers and cover reflected-key failures.
  • Resolve security concern: Kie error responses can expose a Bearer key - Kie's HTTP error call lacks request-header redaction, and its body-level failure messages are surfaced directly.
  • Resolve security concern: Polling failures can expose provider credentials - Z.AI and Novita return vendor failure text that the shared poller throws without exact-key redaction.
  • Resolve merge risk (P1) - A provider or proxy that reflects an active Bearer key in an error can place it in a surfaced video-generation failure.
  • Complete next step (P2) - Redact Kie HTTP and body errors and Z.AI/Novita polling failures using the active request headers, then add reflected-key regression coverage.

Findings

  • [P2] Redact Kie credentials before surfacing provider errors — extensions/kie/video-generation-provider.ts:195
  • [P2] Redact Z.AI and Novita polling failure text — extensions/zai/video-generation-provider.ts:223-228
  • [medium] Kie error responses can expose a Bearer key — extensions/kie/video-generation-provider.ts:195
  • [medium] Polling failures can expose provider credentials — extensions/zai/video-generation-provider.ts:223
Agent review details

Security

Needs attention: No new third-party package or broader CI permission was found, but introduced provider error paths can expose reflected API credentials.

PR surface

Source +1239, Tests +921, Docs +253, Config +34, Generated 0, Other +6. Total +2453 across 43 files.

View PR surface stats
Area Files Added Removed Net
Source 11 1241 2 +1239
Tests 13 926 5 +921
Docs 13 259 6 +253
Config 3 42 8 +34
Generated 2 3 3 0
Other 1 6 0 +6
Total 43 2477 24 +2453

Review metrics

Metric Value Why it matters
Configuration surface 2 credential-only provider overlays, 1 new onboarding flag These are the user-facing setup paths that need to remain aligned with plugin discovery and authentication.
Runtime versus test growth runtime TypeScript +1,164; tests and harness +926 The vendor-specific adapters and model catalog explain the production growth; the new coverage exercises registered provider paths.

Merge-risk options

Maintainer options:

  1. Redact reflected credentials (recommended)
    Use the active request headers when normalizing errors for all three providers and cover a synthetic response that reflects an opaque key.

Technical review

Best possible solution:

Keep the vendor integrations in their plugins and apply the SDK's exact-secret redactor to HTTP, body-level, and polling errors before they reach the shared video tool.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: return a synthetic provider error containing the active Bearer key through a registered video provider and inspect the resulting error. This read-only review did not execute that check.

Is this the best way to solve the issue?

No, not yet: the plugin-owned implementation fits the existing video tool, but its error paths must redact exact active credentials before merge.

Full review comments:

  • [P2] Redact Kie credentials before surfacing provider errors — extensions/kie/video-generation-provider.ts:195
    This HTTP error call omits the active request headers, while the same provider also throws HTTP-200 msg and failMsg text directly. If Kie or a proxy reflects the Bearer key, video_generate can surface it. Pass the active headers to HTTP error handling and redact body-level messages before throwing them.
    Confidence: 0.97
  • [P2] Redact Z.AI and Novita polling failure text — extensions/zai/video-generation-provider.ts:223-228
    The polling helper throws this returned message verbatim; Novita likewise returns task.reason verbatim. A failed provider response that reflects the active key therefore leaks it through the video error. Redact both callbacks against their active headers and cover reflected-key failures.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f8ae4fc466a9.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The feature has useful provider coverage, while the identified security defects are bounded to error paths.
  • merge-risk: 🚨 security-boundary: The introduced provider paths can surface response text containing an active API credential.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body reports real keyed generation and local-image runs through the provider plugins, with MP4 results for Kie, Z.AI, and Novita; combined-branch mocked checks are supplemental. The overlay-ID change accepts configuration without changing a stored-data format.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports real keyed generation and local-image runs through the provider plugins, with MP4 results for Kie, Z.AI, and Novita; combined-branch mocked checks are supplemental. The overlay-ID change accepts configuration without changing a stored-data format.

Evidence

Security concerns:

  • [medium] Kie error responses can expose a Bearer key — extensions/kie/video-generation-provider.ts:195
    Kie's HTTP error call lacks request-header redaction, and its body-level failure messages are surfaced directly.
    Confidence: 0.97
  • [medium] Polling failures can expose provider credentials — extensions/zai/video-generation-provider.ts:223
    Z.AI and Novita return vendor failure text that the shared poller throws without exact-key redaction.
    Confidence: 0.96

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Cover Kie, Z.AI, and Novita failures with synthetic responses reflecting an opaque active key and verify it is absent from surfaced errors.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-28T03:58:59.012Z sha 7264101 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-28T05:19:11.375Z sha e32769c :: blocked before merge. :: none
  • reviewed 2026-09-28T06:14:05.268Z sha 829c43e :: blocked before merge. :: [P2] Redact Kie credentials from provider errors
  • reviewed 2026-09-28T08:25:41.200Z sha d6adf5a :: blocked before merge. :: [P2] Redact Kie credentials from provider errors | [P2] Redact Z.AI and Novita polling failure text

Guard the native-live provider list before splitting and add Kie extension and documentation labeler coverage.

Regenerate the config baseline at exactly 4371 plugin entries. The 21 new paths all belong to the shared Kie plugin entry: root/config/enabled (3), hooks (6), llm (8), and subagent (4). Z.AI and Novita add no config entries; existing core, channel, and plugin entries are unchanged.

Focused labeler and native-live shard tests, config baseline, lint, formatting, and diff checks pass. The targeted TS2532 is removed; 19 inherited type diagnostics remain in untouched files. Workflow-planning has the same 17 unique failures and 432 passes on this branch and merge-base 7c346c1 because its fixture omits ci-static-step.sh.
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@steipete
steipete merged commit 6d6ea35 into main Sep 28, 2026
351 of 357 checks passed
@steipete
steipete deleted the steipete/video-providers-kie-zai-novita branch September 28, 2026 12:48
MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Sep 28, 2026
158 upstream commits, including the Kie AI, Z.AI and Novita video
providers (openclaw#160080) and several CI planner repairs (openclaw#160187, openclaw#160260,
openclaw#160324, openclaw#160376). No file outside the generated set and the test routing
list changed on both sides.

Two conflicts, both generated: docs/.generated/config-baseline.counts.json
and docs/.generated/config-baseline.sha256. openclaw#160080 adds plugin settings,
so plugin goes from 4353 to 4374. This branch keeps channel at 3788 and
core stays at 2464. Both files came from upstream and were regenerated.
test/vitest/vitest.extension-database-workers-paths.mjs changed on both
sides in separate places and merged cleanly, with upstream's ten new
entries and this branch's Feishu entry all kept.

build:docker ran in a separate detached checkout of this commit outside the
nested node_modules install. Regenerating there changed those two files and
nothing else, giving the predicted counts, the upstream core and plugin
hashes, this branch's channel hash and a new combined hash. The three
generated-file checks pass there.

Upstream deleted 38 test files in this range. None of them were added or
changed by this branch.

Feishu: 106 files and 1853 tests in the extension project, 17 files and
312 tests in the database-workers project. The forwarder test and the
routing guards pass, 1980 tests. tsgo:core, tsgo:extensions,
tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines and
assertion-safety ratchets against upstream/main, oxlint and oxfmt on the
43 changed code files all pass.
steipete added a commit that referenced this pull request Sep 28, 2026
#160080 widened both manifests to ["models", "media"] when it added video
generation, which breaks the bundled-plugin rule of exactly one purpose
category and fails bundled-plugin-categories on every plugin-touching PR.
Both remain model providers first; video generation stays a provider
capability without a second catalog category.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…160080)

* feat(kie): add Kie AI video generation provider

Add 13 documented Market video models with automatic text/image routing, local image uploads, body-level API errors, and bounded polling/downloads. Register API-key onboarding and discovery, wire live QA and CI filters, and document provider capabilities.

Validation: 34 mocked Kie cases pass; core/extension types, bundled registration, inventory, docs, workflow, formatting, and assertion-safety checks pass. Independent review found no actionable issues. The new test command took 186.18s including cold compilation. Live provider proof remains with the lead; Veo awaits API contract reconciliation.

* fix(config): allow Runway and Kie provider credentials in models.providers

Treat runway and kie as bundled provider overlays so apiKey credentials, including SecretRefs, validate without custom baseUrl or models fields. Keep credential resolution in the existing provider auth owner.

Validation: both SecretRef-only schema cases failed before the fix and pass afterward (28 schema cases). All 12 Runway cases pass, including a generated request using the real SDK resolver with a resolved file SecretRef snapshot. Core/extension type checks and the fresh independent review of both requested commits pass.

* feat(zai): add CogVideoX video generation

Extend the Z.AI plugin with regional async CogVideoX text-to-video and image-to-video generation. Reuse provider auth and HTTP helpers, support local image data URIs, and declare duration, geometry, audio, quality, and frame-rate controls.

Wire registration, live provider selection, release shards, generated inventory, and provider documentation. Mocked provider flows, focused contracts, typechecks, inventory, docs, formatting, workflow checks, lint, and assertion safety passed. Live proof remains with the lead.

* feat(novita): add Wan and Hailuo video generation

Extend the Novita plugin with native Wan 2.6 and Hailuo 2.3 async video routes, automatic family image routing, data URI image inputs, and model-specific capabilities. Default Wan output to silent and validate Hailuo duration/resolution combinations before submission.

Wire registration, live provider selection, release shards, generated inventory, and concise provider documentation. Mocked registered-provider flows, focused contracts, typechecks, inventory, docs, formatting, workflow checks, lint, and assertion safety passed. Live proof remains with the lead.

* fix(ci): repair video provider integration checks

Guard the native-live provider list before splitting and add Kie extension and documentation labeler coverage.

Regenerate the config baseline at exactly 4371 plugin entries. The 21 new paths all belong to the shared Kie plugin entry: root/config/enabled (3), hooks (6), llm (8), and subagent (4). Z.AI and Novita add no config entries; existing core, channel, and plugin entries are unchanged.

Focused labeler and native-live shard tests, config baseline, lint, formatting, and diff checks pass. The targeted TS2532 is removed; 19 inherited type diagnostics remain in untouched files. Workflow-planning has the same 17 unique failures and 432 passes on this branch and merge-base 2f9bb20 because its fixture omits ci-static-step.sh.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
openclaw#160080 widened both manifests to ["models", "media"] when it added video
generation, which breaks the bundled-plugin rule of exactly one purpose
category and fails bundled-plugin-categories on every plugin-touching PR.
Both remain model providers first; video generation stays a provider
capability without a second catalog category.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: novita extensions: runway extensions: zai merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant