v4.0.2 — Post-release patch pass
Post-release patch pass for v4.0.1. No new models — just bug fixes, validation hardening, accurate pricing, Docker hygiene.
Highlights
- Veo upscale handlers were silently broken (PR #6).
veo_upscale_4kcould never return a URL — kie returnscode: 422even on success withdata.resultUrls(plural), while our handler looked for singularresultUrlandkieRequestthrew on non-200.veo_upscale_1080phad the same throw-on-non-200 issue during processing. Both rewritten with a tolerant fetch + dual singular/plural URL extraction. - Veo PRICING numbers replaced with empirically-measured values (PR #5). Probed each tier 2026-06-01. Every existing rate was wrong, between -75% and +110%:
veo-3/*(Quality): 50 → 31.25 cr/sveo-3-fast/*: 10 → 21 cr/sveo-3-lite/*: 5 → 3.75 cr/sveo/1080p: 20 → 5 cr flatveo/4k: 80 → 120 cr flat
- Polling now tolerant of kie.ai's transient malformed JSON on
/api/v1/jobs/recordInfo(PR #2). Previously a single bad interim poll response would abort a whole 15-minute task with a generic JSON parse error even though kie's task was rendering fine. - Cross-model option validation in
generate_image/generate_video(PR #1).aspect_ratiochecked against each model'saspectRatios; option-levelenum/min/maxenforced. The low-level MCP SDK doesn't validate per-tool inputSchemas — these were getting through as opaque kie.ai errors. gemini-omni/videohardening: array caps +Array.isArraychecks, reference asset quota enforcement (images + videos×2 + character_ids ≤ 7),String()-coercedduration, per-modelmaxPromptChars: 20000, full 30-voice enum onaudio_id, schemamaxLengthconstraints (PRs #1 + #7).- Omni IDs now in
taskHistorysokieAudioId/characterIdsurvive context compaction (PR #7). - Docker hygiene:
npm install→npm ci, new.dockerignore(was streaming multi-GB build context per rebuild) (PR #1).
Verification
Live API integration verified with real Gemini Omni and Veo probes; 663 credits (~$3.32) spent on empirical measurements.
Full diff: v4.0.1...v4.0.2
🤖 Generated with Claude Code