HKUDS/nanobot · error · ImageGenerationError

MiniMax image generation request failed

Error message

MiniMax image generation request failed: {exc}

What it means

Raised in MiniMaxImageGenerator._generate_with_client when the POST to {api_base}/image_generation raises httpx.RequestError (non-timeout transport failure: DNS, connection refused, TLS, reset). The original exception is chained as __cause__ and its text is embedded in the message.

Solutions

  1. Check network connectivity and DNS resolution for the MiniMax host
  2. Verify api_base URL and proxy settings
  3. Check whether MiniMax endpoint is temporarily unavailable
  4. Retry after connectivity is restored
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at nanobot/providers/image_generation.py:1061 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/90e16ec49593dfb8. Report an issue: GitHub.

Appendix: source

Thrown at nanobot/providers/image_generation.py:1061

                {"type": "character", "image_file": ref} for ref in image_refs
            ]

        body.update(self.extra_body)

        return await self._generate_with_client(body, headers)

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

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

        payload = response.json()
        images = _minimax_images_from_payload(payload)

        self._require_images(images, payload)

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


def _minimax_images_from_payload(payload: dict[str, Any]) -> list[str]:
    """Extract base64 images from MiniMax API response.

View on GitHub (pinned to 42f37dc4c0)