HKUDS/nanobot · error · ImageGenerationError

Zhipu image generation timed out

Error message

Zhipu image generation timed out

What it means

Raised in ZhipuImageGenerator._generate_with_client when the POST to the Zhipu images endpoint raises httpx.TimeoutException, i.e. the API (with its long default timeout _ZHIPU_TIMEOUT_S) still did not respond in time. Original exception chained as __cause__.

Solutions

  1. Retry the generation
  2. Check Zhipu API status and network connectivity
  3. Increase the provider timeout if generation is consistently slow
Defensive patterns

Strategy: retry

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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

Appendix: source

Thrown at nanobot/providers/image_generation.py:1875

                body=body,
                url=url,
            )
        finally:
            if self._client is None:
                await client.aclose()

    async def _generate_with_client(
        self,
        client: httpx.AsyncClient,
        *,
        headers: dict[str, str],
        body: dict[str, Any],
        url: str,
    ) -> GeneratedImageResponse:
        try:
            response = await self._http_post(url, headers=headers, body=body, client=client)
        except httpx.TimeoutException as exc:
            raise ImageGenerationError("Zhipu image generation timed out") from exc
        except httpx.RequestError as exc:
            raise ImageGenerationError(f"Zhipu image generation request failed: {exc}") from exc

        try:
            response.raise_for_status()
        except httpx.HTTPStatusError as exc:
            detail = response.text[:500]
            raise ImageGenerationError(f"Zhipu image generation failed: {detail}") from exc

        payload = response.json()
        images = await _zhipu_images_from_payload(payload, proxy=self.proxy)

        self._require_images(images, payload)

        return GeneratedImageResponse(images=images, content="", raw=payload)


def _zhipu_size(

View on GitHub (pinned to 42f37dc4c0)