{"record":{"id":"4bdfeba0c85ac004","repo":"calesthio/OpenMontage","slug":"tokenhub-task-task-id-completed-but-no-data-ur","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/graphics/hunyuan_image.py","lineNumber":503,"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                urls = [item.get(\"url\") for item in result_data if item.get(\"url\")]\n                if not urls:\n                    raise RuntimeError(\n                        f\"TokenHub task {task_id} completed but no data[].url: {data}\"\n                    )\n                return urls\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":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/graphics/hunyuan_image.py#L485-L521","documentation":"RuntimeError raised when a TokenHub task reports status 'completed' but its data array contains no objects with a 'url' field. The poller expects at least one downloadable URL in data[].url; a completed task with an empty data array or items lacking urls is treated as a contract violation.","triggerScenarios":"Upstream generation completed but produced zero images (e.g. content filtered at the output stage); API version returning URLs under a different key (e.g. image_url, b64) instead of url; partially-truncated response body.","commonSituations":"Content-policy soft-filters that mark tasks completed without output; schema drift in the TokenHub response; rare server-side storage failures where the generated asset is not uploaded.","solutions":["Log the full task payload (included in the exception message) to see what data[] actually contains","Adjust the prompt to avoid potentially filtered subject matter and retry","If data[] items use a different URL key, extend the urls extraction in _poll_task to include it","Fall back to base64-decoding if the API returns inline image data instead of URLs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    urls = client._poll_task(task_id, ...)\nexcept RuntimeError as e:\n    if \"no data[].url\" in str(e):\n        # completed without output; usually content filtering or schema drift\n        raise","preventionTips":["Avoid prompts likely to be output-filtered","Keep a response logger in dev to detect renamed URL keys","Retain task payloads for support escalation"],"tags":["hunyuan","tokenhub","empty-result","schema"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}