fix(video): provider-aware plan validation and MuAPI review follow-ups - #35
Merged
Conversation
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
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
Follow-ups from the #33 review (the items called out as non-blocking when it was merged):
ovs plan validateand MCPplan_validaterunvalidatePlanWithProvider:validateEdl(unchanged, provider-neutral) plus a check of every generate video segment'sratio,generation_duration_sec, andoperationagainst the configuredvideo.provider's limits (E_SPEC_GENERATE_PROVIDER). MuAPI's Kling endpoints accept only16:9/9:16/1:1, 5 or 10 s, andgenerate; Atlas has noedit. 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 oldvalidateEdlmessage "not supported by the BYO Seedance adapter" is now neutral.video.providerno longer breaks image / TTS.loadConfigstill lower-cases and trims the name, but unknown values pass through and are rejected by the video adapter atovs videotime (video: unsupported provider "seedance"; expected doubao, atlas, or muapi).MUAPI_API_KEYprecedence is unchanged (explicitmuapionly).providerErrorMessageis 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 invideo.tsfor poll errors.providerBase(cfg, default)replacesarkBase/atlasBase/muapiBase; the Seedance/Atlas 4–15 s range and the plan ratio list are single constants that the adapterlimitsreuse.Docs: README and
stage-plannote thatovs plan validatealso checks the configured provider.Verification
corepack pnpm build,corepack pnpm typecheckcorepack pnpm test: 263 passed, 10 skipped (12 new tests:plan-provider.test.ts,providerErrorMessageshapes, config tolerance, FastAPI 422 detail, neutral ratio wording)ovs plan validateon a4:3/ 8 s generate plan → ok with doubao or no video config, twoE_SPEC_GENERATE_PROVIDERerrors with muapi; a config withvideo.provider: "seedance"no longer failsovs speech-capabilitieswhileovs videoreports the unsupported provider.git diff --check🤖 Generated with Claude Code
https://claude.ai/code/session_01AXDUkkppdaJhxKb7t8DbD9