{"record":{"id":"9ce40c1af3371d8e","repo":"calesthio/OpenMontage","slug":"tokenhub-submit-returned-no-task-id-data","errorCode":null,"errorMessage":"TokenHub submit returned no task id: {data}","messagePattern":"TokenHub submit returned no task id: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/graphics/hunyuan_image.py","lineNumber":459,"sourceCode":"        import requests\n\n        body = {\n            \"model\": model,\n            **payload,\n        }\n        url = f\"https://{_HOST}{_SUBMIT_PATH}\"\n        resp = requests.post(\n            url,\n            json=body,\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        task_id = data.get(\"id\")\n        if not task_id:\n            raise RuntimeError(\n                f\"TokenHub submit returned no task id: {data}\"\n            )\n        return task_id\n\n    def _poll_task(\n        self,\n        task_id: str,\n        *,\n        model: str,\n        api_key: str,\n        poll_interval: float,\n        timeout_seconds: int,\n    ) -> list[str]:\n        \"\"\"Poll /v1/api/image/query until completion, return image download URLs.\n\n        Response when completed:\n        {\"status\": \"completed\", \"data\": [{\"url\": \"...\", \"revised_prompt\": \"...\"}]}\n","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/graphics/hunyuan_image.py#L441-L477","documentation":"RuntimeError raised when the TokenHub (Tencent) submit endpoint returns HTTP 200 with an error-free JSON body but no 'id' field. The submit helper already validated the response via _json_or_raise and _check_response, so a missing task id means the API accepted the request shape but did not enqueue a job.","triggerScenarios":"POST to the TokenHub submit path returning an unexpected-but-valid JSON envelope, e.g. {'status': 'ok'} with no id; upstream API version change moving the task id to a different key; account-level restrictions that return a terse acknowledgement instead of a queued task.","commonSituations":"TokenHub API schema drift after an upgrade; misconfigured model identifier that the API silently 'accepts'; regional endpoint variants with a different response envelope.","solutions":["Print/log the full response body (it is included in the message) and compare against current TokenHub docs for the submit endpoint","Confirm the model name and request body fields match the documented submit schema","Verify the TENCENT_TOKENHUB_API_KEY belongs to an account with access to the requested model","If the key name changed upstream (e.g. id -> task_id), update the extraction in hunyuan_image.py accordingly"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    task_id = client._submit(body, api_key=key)\nexcept RuntimeError as e:\n    if \"no task id\" in str(e):\n        # response body is embedded; compare against current TokenHub docs\n        raise","preventionTips":["Pin the tool version to the TokenHub API contract you tested against","Log submit responses in dev to catch schema drift early","Verify account/model access before building pipelines on a new model"],"tags":["hunyuan","tokenhub","api-contract","async-job"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}