{"record":{"id":"efe510a31f39c5db","repo":"calesthio/OpenMontage","slug":"tokenhub-task-task-id-completed-but-no-data-url","errorCode":null,"errorMessage":"TokenHub task {task_id} completed but no data.url: {data}","messagePattern":"TokenHub task (.+?) completed but no data\\.url: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/video/hunyuan_cloud_video.py","lineNumber":472,"sourceCode":"        while time.time() < deadline:\n            time.sleep(poll_interval)\n\n            resp = requests.post(\n                url,\n                json={\"model\": model, \"id\": task_id},\n                headers=self._auth_headers(api_key),\n                timeout=30,\n            )\n            data = self._json_or_raise(resp)\n            self._check_response(data)\n\n            status = data.get(\"status\", \"\")\n\n            if status == \"completed\":\n                result_data = data.get(\"data\") or {}\n                video_url = result_data.get(\"url\")\n                if not video_url:\n                    raise RuntimeError(\n                        f\"TokenHub task {task_id} completed but no data.url: {data}\"\n                    )\n                return video_url\n\n            if status == \"failed\":\n                error_info = data.get(\"error\") or {}\n                error_msg = error_info.get(\"message\", \"unknown error\")\n                raise RuntimeError(\n                    f\"TokenHub task {task_id} failed: {error_msg}\"\n                )\n\n            # queued / running / in_progress — continue polling\n            if status not in (\"queued\", \"running\", \"in_progress\"):\n                raise RuntimeError(\n                    f\"TokenHub task {task_id} returned unknown status: {status}\"\n                )\n\n        raise TimeoutError(","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/hunyuan_cloud_video.py#L454-L490","documentation":"Raised when TokenHub reports status='completed' for a video task but data.url is missing. The tool treats 'completed' as terminal and expects the downloadable video URL at data.url; a completion without a URL is a contract violation (or a partial success with the result stored elsewhere), so it raises with the full poll response embedded.","triggerScenarios":"Poll GET returns status 'completed' while data is null/{} or lacks 'url' — e.g. result delivered under a different key (video_url, output), a CDN upload step failed after render, or the response envelope changed.","commonSituations":"TokenHub schema drift renaming the result field; transient server issue where completion is marked but artifact publication lags; a model variant returning results in a nested structure.","solutions":["Inspect the {data} payload in the error to find where the URL actually is; if it is consistently under another key, the tool needs a patch.","Retry the whole generation — artifact-publication races usually resolve on a fresh task.","Check for OpenMontage updates handling the new TokenHub response shape.","Verify with TokenHub docs/support whether 'completed' can omit url by design for your model."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = hunyuan_cloud_video(inputs)\nexcept RuntimeError as e:\n    if \"no data.url\" in str(e):\n        result = hunyuan_cloud_video(inputs)  # one retry: publication race\n    else:\n        raise","preventionTips":["Retry completed-without-url once before escalating — often a publication race.","Report recurring shape drift with the embedded response payload."],"tags":["hunyuan","tokenhub","api-contract","polling","missing-result"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}