calesthio/OpenMontage · error · RuntimeError

TokenHub submit returned no task id: {data}

Error message

TokenHub submit returned no task id: {data}

What it means

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.

Source

Thrown at tools/graphics/hunyuan_image.py:459

        import requests

        body = {
            "model": model,
            **payload,
        }
        url = f"https://{_HOST}{_SUBMIT_PATH}"
        resp = requests.post(
            url,
            json=body,
            headers=self._auth_headers(api_key),
            timeout=30,
        )
        data = self._json_or_raise(resp)
        self._check_response(data)

        task_id = data.get("id")
        if not task_id:
            raise RuntimeError(
                f"TokenHub submit returned no task id: {data}"
            )
        return task_id

    def _poll_task(
        self,
        task_id: str,
        *,
        model: str,
        api_key: str,
        poll_interval: float,
        timeout_seconds: int,
    ) -> list[str]:
        """Poll /v1/api/image/query until completion, return image download URLs.

        Response when completed:
        {"status": "completed", "data": [{"url": "...", "revised_prompt": "..."}]}

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Print/log the full response body (it is included in the message) and compare against current TokenHub docs for the submit endpoint
  2. Confirm the model name and request body fields match the documented submit schema
  3. Verify the TENCENT_TOKENHUB_API_KEY belongs to an account with access to the requested model
  4. If the key name changed upstream (e.g. id -> task_id), update the extraction in hunyuan_image.py accordingly
Defensive patterns

Strategy: try-catch

Try / catch

try:
    task_id = client._submit(body, api_key=key)
except RuntimeError as e:
    if "no task id" in str(e):
        # response body is embedded; compare against current TokenHub docs
        raise

Prevention

When it happens

Trigger: 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.

Common situations: TokenHub API schema drift after an upgrade; misconfigured model identifier that the API silently 'accepts'; regional endpoint variants with a different response envelope.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/9ce40c1af3371d8e. Report an issue: GitHub.