{"record":{"id":"75ec06327f983cea","repo":"calesthio/OpenMontage","slug":"kling-identify-face-requires-video-id-or-video-url","errorCode":null,"errorMessage":"Kling identify_face requires video_id or video_url","messagePattern":"Kling identify_face requires video_id or video_url","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/avatar/kling_lip_sync.py","lineNumber":357,"sourceCode":"                **self._callback_result_data(inputs, task_id),\n                **probed,\n            },\n            artifacts=[str(path) for path in paths],\n            cost_usd=self.estimate_cost(inputs),\n            duration_seconds=round(time.time() - start, 2),\n            model=\"kling-official-lip-sync\",\n        )\n\n    def _build_identify_request(self, inputs: dict[str, Any]) -> dict[str, Any]:\n        if inputs.get(\"video_path\") and not (inputs.get(\"video_url\") or inputs.get(\"video_id\")):\n            raise ValueError(\"Kling identify_face requires video_url or video_id; local video paths cannot be silently uploaded.\")\n        payload: dict[str, Any] = {}\n        if inputs.get(\"video_id\"):\n            payload[\"video_id\"] = str(inputs[\"video_id\"])\n        if inputs.get(\"video_url\"):\n            payload[\"video_url\"] = str(inputs[\"video_url\"])\n        if not payload:\n            raise ValueError(\"Kling identify_face requires video_id or video_url\")\n        return {\n            \"path\": \"/v1/videos/identify-face\",\n            \"payload\": payload,\n            \"operation\": \"identify_face\",\n        }\n\n    def _build_advanced_request(self, inputs: dict[str, Any]) -> dict[str, Any]:\n        session_id = str(inputs.get(\"session_id\") or \"\").strip()\n        if not session_id:\n            raise ValueError(\"advanced_lip_sync requires session_id\")\n        face_choose = self._normalize_face_choose(inputs)\n        if not face_choose:\n            raise ValueError(\"advanced_lip_sync requires face_choose or face_id\")\n        if len(face_choose) != 1:\n            raise ValueError(\"advanced_lip_sync currently supports exactly one face_choose item\")\n        face_item = face_choose[0]\n        audio_source = self._copy_audio_input(inputs, face_item)\n        self._copy_timing_fields(inputs, face_item)","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/avatar/kling_lip_sync.py#L339-L375","documentation":"ValueError from _build_identify_request when the payload ends up empty: neither video_id nor video_url was provided (and no video_path trigger from the sibling guard). Face identification operates on an existing video, so exactly one of these references is required.","triggerScenarios":"Calling kling_lip_sync operation='identify_face' with no video reference at all; passing video under an unrecognized key (e.g. 'file' or 'source').","commonSituations":"Input dict built dynamically and the video field never got set; key-name confusion between tools.","solutions":["Pass video_id (from a prior Kling upload) or video_url (public HTTPS URL) in the inputs.","If the video is local, see the explicit-upload requirement (upload first — do not use video_path).","Log the inputs dict before calling to confirm which keys are actually present."],"exampleFix":"// before\nresult = tool.run({\"operation\": \"identify_face\"})\n\n// after\nresult = tool.run({\"operation\": \"identify_face\", \"video_url\": \"https://cdn.example.com/clip.mp4\"})","handlingStrategy":"validation","validationCode":"assert inputs.get(\"video_id\") or inputs.get(\"video_url\"), \\\n    \"identify_face requires video_id or video_url (upload local files first)\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make the video reference a required field in wrapper schemas","Log the input keys before calling to catch dynamically-built dicts missing the video field"],"tags":["kling","lip-sync","required-field","input-validation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}