{"record":{"id":"7bfe34fbfa7065b0","repo":"calesthio/OpenMontage","slug":"image-list-items-must-include-image-image-url-or","errorCode":null,"errorMessage":"image_list items must include image, image_url, or image_path","messagePattern":"image_list items must include image, image_url, or image_path","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/graphics/kling_official_image.py","lineNumber":354,"sourceCode":"            if not value:\n                return\n            image_list.append({\"image\": value, \"source\": source or value, \"source_type\": source_type})\n            references_used.append(\n                {\n                    \"kind\": \"image\",\n                    \"source\": source or value,\n                    \"source_type\": source_type,\n                    \"placeholder\": f\"<<<image_{len(image_list)}>>>\",\n                }\n            )\n\n        for item in inputs.get(\"image_list\") or []:\n            if not isinstance(item, dict):\n                raise ValueError(\"image_list items must be objects\")\n            source = item.get(\"image\") or item.get(\"image_url\") or item.get(\"image_path\")\n            value = normalize_image_input(item.get(\"image\") or item.get(\"image_url\"), item.get(\"image_path\"))\n            if not value:\n                raise ValueError(\"image_list items must include image, image_url, or image_path\")\n            add_image(value, source=source, source_type=\"image_list\")\n        for url in inputs.get(\"image_urls\") or []:\n            add_image(normalize_image_input(url=url), source=url, source_type=\"image_urls\")\n        for path in inputs.get(\"image_paths\") or []:\n            add_image(normalize_image_input(path=path), source=str(path), source_type=\"image_paths\")\n        if inputs.get(\"image_url\") or inputs.get(\"image_path\"):\n            add_image(\n                normalize_image_input(inputs.get(\"image_url\"), inputs.get(\"image_path\")),\n                source=inputs.get(\"image_url\") or inputs.get(\"image_path\"),\n                source_type=\"image\",\n            )\n\n        return image_list, references_used\n\n    def _download_images(self, client: KlingClient, outputs: list[dict[str, Any]], inputs: dict[str, Any]) -> list[Path]:\n        if not outputs:\n            raise ValueError(\"Kling image response contained no images\")\n        base_path = Path(inputs.get(\"output_path\", \"kling_official_image.png\"))","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/graphics/kling_official_image.py#L336-L372","documentation":"ValueError from the omni image-list normalizer when an image_list item is an object but none of its image, image_url, or image_path keys resolve to a usable value via normalize_image_input. Keys with empty strings, None values, or unrecognized key names produce no normalized image and raise.","triggerScenarios":"Passing {\"url\": \"...\"} (wrong key name), {\"image_url\": \"\"} (empty), or {\"image_path\": null}; items where all candidate keys are absent; whitespace-only values.","commonSituations":"Key-name drift between caller and tool (url vs image_url); optional fields serialized as empty strings instead of being omitted; template payloads with placeholder values never filled in.","solutions":["Use exactly one of the keys image, image_url, or image_path per item with a non-empty value","Omit keys you do not have rather than sending null or ''","For local files confirm the path exists — normalize_image_input returns nothing for missing files","Add a pre-flight filter in caller code dropping items that fail validation"],"exampleFix":"// before\ninputs = {\"image_list\": [{\"url\": \"https://cdn/img1.png\"}]}\n// after\ninputs = {\"image_list\": [{\"image_url\": \"https://cdn/img1.png\"}]}","handlingStrategy":"type-guard","validationCode":"for item in inputs.get(\"image_list\") or []:\n    assert item.get(\"image\") or item.get(\"image_url\") or item.get(\"image_path\"), f\"item lacks an image key: {item}\"","typeGuard":"def item_has_image(item: dict) -> bool:\n    return bool(\n        isinstance(item, dict)\n        and (item.get(\"image\") or item.get(\"image_url\") or item.get(\"image_path\"))\n    )","tryCatchPattern":null,"preventionTips":["Use exactly the documented keys; omit absent ones rather than nulling them","Ensure local paths in items exist before submit","Drop invalid items up front rather than failing the whole request"],"tags":["kling","image-generation","validation","missing-argument"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}