{"record":{"id":"710158e354c40148","repo":"HKUDS/nanobot","slug":"reference-images-must-be-inside-the-workspace-or-n","errorCode":null,"errorMessage":"reference_images must be inside the workspace or nanobot media directory","messagePattern":"reference_images must be inside the workspace or nanobot media directory","errorType":"exception","errorClass":"ImageGenerationError","httpStatus":null,"severity":"error","filePath":"nanobot/agent/tools/image_generation.py","lineNumber":162,"sourceCode":"            \"extra_body\": provider.extra_body\n            if provider and isinstance(provider.extra_body, dict) else None,\n            \"proxy\": provider.proxy if provider and isinstance(provider.proxy, str) else None,\n        }\n        return cls(**kwargs)\n\n    def _resolve_reference_image(self, value: str) -> str:\n        access = current_tool_workspace(self.workspace, restrict_to_workspace=True)\n        workspace = access.project_path or self.workspace\n        try:\n            resolved = resolve_allowed_path(\n                value,\n                workspace=workspace,\n                allowed_root=access.allowed_root,\n                extra_allowed_roots=[get_media_dir()] if access.allowed_root is not None else None,\n                strict=True,\n            )\n        except WorkspaceBoundaryError as exc:\n            raise ImageGenerationError(\n                \"reference_images must be inside the workspace or nanobot media directory\"\n            ) from exc\n        except OSError as exc:\n            raise ImageGenerationError(f\"reference image not found: {value}\") from exc\n        if not resolved.is_file():\n            raise ImageGenerationError(f\"reference image is not a file: {value}\")\n        raw = resolved.read_bytes()\n        if detect_image_mime(raw) is None:\n            raise ImageGenerationError(f\"unsupported reference image: {value}\")\n        return str(resolved)\n\n    def _resolve_reference_images(self, values: list[str] | None) -> list[str]:\n        if not values:\n            return []\n        return [self._resolve_reference_image(value) for value in values if value]\n\n    async def execute(  # pyright: ignore[reportIncompatibleMethodOverride]\n        self,","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/agent/tools/image_generation.py#L144-L180","documentation":"Error \"reference_images must be inside the workspace or nanobot media directory\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/agent/tools/image_generation.py:162 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"}