HKUDS/nanobot · error · ImageGenerationError

ModelScope task polling failed: {detail}

Error message

ModelScope task polling failed: {detail}

What it means

Error "ModelScope task polling failed: {detail}" thrown in HKUDS/nanobot.

Source

Thrown at nanobot/providers/image_generation.py:2078

        poll_headers = {
            "Authorization": submit_headers["Authorization"],
            "X-ModelScope-Task-Type": "image_generation",
            **self.extra_headers,
        }
        poll_url = f"{self.api_base}/tasks/{task_id}"

        for _ in range(_MODELSCOPE_POLL_MAX_ATTEMPTS):
            try:
                response = await client.get(poll_url, headers=poll_headers)
            except httpx.RequestError:
                await asyncio.sleep(_MODELSCOPE_POLL_INTERVAL_S)
                continue

            try:
                response.raise_for_status()
            except httpx.HTTPStatusError as exc:
                detail = _http_error_detail(response)
                raise ImageGenerationError(
                    f"ModelScope task polling failed: {detail}"
                ) from exc

            data = response.json()
            status = data.get("task_status")

            if status == "SUCCEED":
                return await self._collect_images(data)
            if status == "FAILED":
                raise ImageGenerationError(
                    f"ModelScope image generation task failed: {data}"
                )

            await asyncio.sleep(_MODELSCOPE_POLL_INTERVAL_S)

        raise ImageGenerationError(
            f"ModelScope image generation timed out after "
            f"{_MODELSCOPE_POLL_MAX_ATTEMPTS} polls"

View on GitHub (pinned to 42f37dc4c0)

When it happens

Trigger: Thrown at nanobot/providers/image_generation.py:2078 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/7c32a0e58e97de42. Report an issue: GitHub.