{"record":{"id":"6d23be2964caeb48","repo":"calesthio/OpenMontage","slug":"video-edit-requires-video-url-video-path-or-refe","errorCode":null,"errorMessage":"video_edit requires video_url, video_path, or reference_video_path","messagePattern":"video_edit requires video_url, video_path, or reference_video_path","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/atlas_video.py","lineNumber":288,"sourceCode":"                    *({\"url\": value, \"type\": \"audio\"} for value in audios),\n                ]\n                if image:\n                    refers.insert(0, {\"url\": image, \"type\": \"image\"})\n            if not refers or not any(item.get(\"type\") in {\"image\", \"video\"} for item in refers):\n                raise ValueError(\"MiniMax H3 reference_to_video requires at least one image or video in refers\")\n            payload[\"refers\"] = refers\n        elif style == \"gemini_video_clips\":\n            clips = list(inputs.get(\"video_clips\") or [])\n            if not clips and video:\n                clips = [{\"url\": video, \"start\": 0, \"ends\": min(int(inputs.get(\"duration\", 10)), 10)}]\n            if len(clips) != 1:\n                raise ValueError(\"Gemini Omni developer reference_to_video requires exactly one video_clip\")\n            payload[\"video_clips\"] = clips\n            if images:\n                payload[\"images\"] = images\n        elif style == \"gemini_video_edit\":\n            if not video:\n                raise ValueError(\"video_edit requires video_url, video_path, or reference_video_path\")\n            payload[\"video\"] = video\n            if images:\n                if len(images) > spec[\"media_limits\"].get(\"images\", 10):\n                    raise ValueError(\"Gemini Omni video_edit accepts at most 10 reference images\")\n                payload[\"images\"] = images\n\n        extra = inputs.get(\"extra_params\")\n        if isinstance(extra, dict):\n            payload.update(extra)\n        return payload\n\n    @staticmethod\n    def _upload_value(value: str | None, api_key: str) -> str | None:\n        if not value or _is_remote(value):\n            return value\n        return atlas_client.upload_media(value, api_key)\n\n    def _resolve_media(self, inputs: dict[str, Any], api_key: str) -> dict[str, Any]:","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/atlas_video.py#L270-L306","documentation":"Raised in _build_payload for media_style=='gemini_video_edit' when no source video was supplied: the tool checks video_url and reference_video_url (path-based video keys normalized earlier also failed). The video_edit operation edits an existing video, so a video input is mandatory.","triggerScenarios":"Calling operation='video_edit' with only a prompt and images; supplying the video under 'video' or 'source_video' (unread keys); the local video_path key misspelled so its normalized value never landed in video_url/reference_video_url.","commonSituations":"Treating video_edit as text-to-video with style images; renaming keys in an adapter layer; upstream upload of the local video failing silently leaving the URL field empty.","solutions":["Add video_url (remote) or video_path/reference_video_path (local file) to inputs","Optionally attach up to 10 reference_images for the edit guidance","If you meant to generate from scratch, use a text-to-video operation/model instead"],"exampleFix":"# before\ninputs = {'model':'google/gemini-omni-flash','operation':'video_edit','prompt':'make the sky sunset'}\n\n# after\ninputs = {'model':'google/gemini-omni-flash','operation':'video_edit','prompt':'make the sky sunset','video_path':'input/scene.mp4'}","handlingStrategy":"validation","validationCode":"video = inputs.get('video_url') or inputs.get('video_path') or inputs.get('reference_video_path')\nif not video:\n    raise ValueError('video_edit needs a source video')\nif inputs.get('video_path') and not Path(inputs['video_path']).is_file():\n    raise ValueError(f\"video file missing: {inputs['video_path']}\")","typeGuard":"def has_edit_video(inputs: dict) -> bool:\n    return bool(inputs.get('video_url') or inputs.get('reference_video_url') or\n                inputs.get('video_path') or inputs.get('reference_video_path'))","tryCatchPattern":"try:\n    result = atlas_video.run(inputs=inputs)\nexcept ValueError as e:\n    if 'video_edit requires' in str(e):\n        raise SystemExit('video_edit edits an existing video — attach one') from e\n    raise","preventionTips":["Use video_path for local files, video_url for remote; never 'video' or 'source_video'","Assert the edit source exists after any download/cut step","Keep a single input-builder keyed by operation so video_edit always carries a video"],"tags":["atlas-cloud","gemini","video-edit","validation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}