{"record":{"id":"f0c5eda6224e0821","repo":"HKUDS/nanobot","slug":"failed-to-download-generated-image-http-response","errorCode":null,"errorMessage":"failed to download generated image (HTTP {response.status_code})","messagePattern":"failed to download generated image \\(HTTP (.+?)\\)","errorType":"exception","errorClass":"ImageGenerationError","httpStatus":null,"severity":"error","filePath":"nanobot/providers/image_generation.py","lineNumber":206,"sourceCode":"                        if not location:\n                            raise ImageGenerationError(\n                                \"generated image URL redirected without a location\"\n                            )\n                        current_url = urljoin(str(response.url), location)\n                        continue\n\n                    try:\n                        response.raise_for_status()\n                    except httpx.HTTPStatusError as exc:\n                        raise ImageGenerationError(\n                            f\"failed to download generated image (HTTP {response.status_code})\"\n                        ) from exc\n\n                    declared_size = response.headers.get(\"content-length\")\n                    if declared_size:\n                        try:\n                            if int(declared_size) > _IMAGE_DOWNLOAD_MAX_BYTES:\n                                raise ImageGenerationError(\n                                    \"generated image exceeded the 32 MiB download limit\"\n                                )\n                        except ValueError:\n                            pass\n\n                    chunks: list[bytes] = []\n                    total = 0\n                    async for chunk in response.aiter_bytes():\n                        total += len(chunk)\n                        if total > _IMAGE_DOWNLOAD_MAX_BYTES:\n                            raise ImageGenerationError(\n                                \"generated image exceeded the 32 MiB download limit\"\n                            )\n                        chunks.append(chunk)\n                    raw = b\"\".join(chunks)\n                    break\n            else:\n                raise ImageGenerationError(\"generated image URL exceeded the redirect limit\")","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/providers/image_generation.py#L188-L224","documentation":"Error \"failed to download generated image (HTTP {response.status_code})\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/providers/image_generation.py:206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}