Skip to content

fix(video): provider-aware plan validation and MuAPI review follow-ups - #35

Merged
leochenpm merged 1 commit into
mainfrom
fix/muapi-review-followups
Sep 4, 2026
Merged

fix(video): provider-aware plan validation and MuAPI review follow-ups#35
leochenpm merged 1 commit into
mainfrom
fix/muapi-review-followups

Conversation

@leochenpm

Copy link
Copy Markdown
Collaborator

Summary

Follow-ups from the #33 review (the items called out as non-blocking when it was merged):

  • Gate C is now provider-aware. ovs plan validate and MCP plan_validate run validatePlanWithProvider: validateEdl (unchanged, provider-neutral) plus a check of every generate video segment's ratio, generation_duration_sec, and operation against the configured video.provider's limits (E_SPEC_GENERATE_PROVIDER). MuAPI's Kling endpoints accept only 16:9/9:16/1:1, 5 or 10 s, and generate; Atlas has no edit. Doubao matches the neutral contract, so existing plans are unaffected, and a plan with no video generation never needs a video provider. A field the neutral validator already rejected is not reported twice. The old validateEdl message "not supported by the BYO Seedance adapter" is now neutral.
  • A typo in video.provider no longer breaks image / TTS. loadConfig still lower-cases and trims the name, but unknown values pass through and are rejected by the video adapter at ovs video time (video: unsupported provider "seedance"; expected doubao, atlas, or muapi). MUAPI_API_KEY precedence is unchanged (explicit muapi only).
  • Array-shaped provider error bodies. providerErrorMessage is exported from core, handles FastAPI-style {detail: [{loc, msg, type}]} (surfacing e.g. HTTP 422: duration: Input should be 5 or 10), and replaces the duplicate helper in video.ts for poll errors.
  • Dedup. One providerBase(cfg, default) replaces arkBase/atlasBase/muapiBase; the Seedance/Atlas 4–15 s range and the plan ratio list are single constants that the adapter limits reuse.

Docs: README and stage-plan note that ovs plan validate also checks the configured provider.

Verification

  • corepack pnpm build, corepack pnpm typecheck
  • corepack pnpm test: 263 passed, 10 skipped (12 new tests: plan-provider.test.ts, providerErrorMessage shapes, config tolerance, FastAPI 422 detail, neutral ratio wording)
  • Built CLI: ovs plan validate on a 4:3 / 8 s generate plan → ok with doubao or no video config, two E_SPEC_GENERATE_PROVIDER errors with muapi; a config with video.provider: "seedance" no longer fails ovs speech-capabilities while ovs video reports the unsupported provider.
  • git diff --check

🤖 Generated with Claude Code

https://claude.ai/code/session_01AXDUkkppdaJhxKb7t8DbD9

Follow-ups from the PR #33 review:

- `ovs plan validate` / MCP `plan_validate` now check every generate video
  segment's ratio, duration, and operation against the configured
  `video.provider` (E_SPEC_GENERATE_PROVIDER), so Gate C no longer approves
  a plan that MuAPI's Kling endpoints (16:9/9:16/1:1, 5 or 10 s, generate
  only) or Atlas (no edit) will reject at generation time. The neutral
  `validateEdl` message no longer names the Seedance adapter.
- `loadConfig` lower-cases `video.provider` but no longer throws on an
  unknown name; the video adapter rejects it, so a typo cannot break the
  image / TTS commands that share the config.
- Provider error bodies: `providerErrorMessage` (exported from core) handles
  FastAPI-style `{detail: [{loc, msg}]}` arrays and names the field, and
  replaces the duplicate helper in video.ts.
- One `providerBase` helper replaces the three per-provider base_url copies.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AXDUkkppdaJhxKb7t8DbD9
@leochenpm
leochenpm merged commit 7b4fae6 into main Sep 4, 2026
1 check passed
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