{"record":{"id":"3ab3bb384ebdc46b","repo":"BerriAI/litellm","slug":"runwayml-response-missing-task-id","errorCode":null,"errorMessage":"RunwayML response missing task ID","messagePattern":"RunwayML response missing task ID","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/runwayml/image_generation/transformation.py","lineNumber":336,"sourceCode":"            \"output\": [\"https://cloudfront.net/.../image.png\"],\n            \"completedAt\": \"2025-11-13T...\"\n        }\n        \"\"\"\n        try:\n            response_data = raw_response.json()\n        except Exception as e:\n            raise self.get_error_class(\n                error_message=f\"Error transforming image generation response: {e}\",\n                status_code=raw_response.status_code,\n                headers=raw_response.headers,\n            )\n\n        verbose_logger.debug(\"RunwayML starting polling...\")\n\n        # Get task ID\n        task_id: Final = response_data.get(\"id\")\n        if not task_id:\n            raise ValueError(\"RunwayML response missing task ID\")\n\n        # Get headers for polling (need auth)\n        poll_headers: Final = {\n            \"Authorization\": raw_response.request.headers.get(\"Authorization\", \"\"),\n            \"X-Runway-Version\": raw_response.request.headers.get(\"X-Runway-Version\", RUNWAYML_DEFAULT_API_VERSION),\n        }\n\n        # Poll until task completes\n        raw_response = self._poll_task_sync(\n            task_id=task_id,\n            api_base=self.DEFAULT_BASE_URL,\n            headers=poll_headers,\n            timeout_secs=RUNWAYML_POLLING_TIMEOUT,\n        )\n\n        # Update response_data with polled result\n        response_data = raw_response.json()\n","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/runwayml/image_generation/transformation.py#L318-L354","documentation":"Contract guard in the RunwayML image-generation response transformation: the JSON parsed fine but carries no 'id' field, so there is no task to poll for the generated image; the handler rejects the response rather than hanging.","triggerScenarios":"Triggered when the RunwayML image generation response does not contain a task ID.","commonSituations":"See trigger scenarios.","solutions":["The RunwayML response lacked a task id; inspect the raw response.","Verify the API key and request body against the RunwayML API docs."],"exampleFix":"# log the response body from RunwayML to see the actual payload.","handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}