{"record":{"id":"6199070d21aa17a1","repo":"OpenBMB/ChatDev","slug":"attachment-path-is-file-size-bytes-exceeds","errorCode":null,"errorMessage":"Attachment '{path}' is {file_size} bytes; exceeds inline limit of {self.MAX_INLINE_FILE_BYTES} bytes","messagePattern":"Attachment '(.+?)' is (.+?) bytes; exceeds inline limit of (.+?) bytes","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"runtime/node/agent/providers/openai_provider.py","lineNumber":778,"sourceCode":"        if isinstance(payload, dict):\n            return payload.get(key)\n        return None\n\n    def _maybe_to_dict(self, payload: Any) -> Dict[str, Any]:\n        if hasattr(payload, \"model_dump\"):\n            try:\n                return payload.model_dump()\n            except Exception:\n                return {}\n        if isinstance(payload, dict):\n            return payload\n        return {}\n\n    def _make_data_uri_from_path(self, path: str, mime_type: Optional[str]) -> str:\n        mime = mime_type or \"application/octet-stream\"\n        file_size = os.path.getsize(path)\n        if file_size > self.MAX_INLINE_FILE_BYTES:\n            raise ValueError(\n                f\"Attachment '{path}' is {file_size} bytes; exceeds inline limit of {self.MAX_INLINE_FILE_BYTES} bytes\"\n            )\n        with open(path, \"rb\") as handle:\n            encoded = base64.b64encode(handle.read()).decode(\"utf-8\")\n        return f\"data:{mime};base64,{encoded}\"\n\n    def _serialize_function_call_output_event(\n        self,\n        event: FunctionCallOutputEvent,\n    ) -> Dict[str, Any]:\n        payload: Dict[str, Any] = {\n            \"type\": event.type,\n            \"call_id\": event.call_id or event.function_name or \"tool_call\",\n        }\n        if event.output_blocks:\n            payload[\"output\"] = self._serialize_blocks(event.output_blocks, MessageRole.TOOL)\n        else:\n            text = event.output_text or \"\"","sourceCodeStart":760,"sourceCodeEnd":796,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/runtime/node/agent/providers/openai_provider.py#L760-L796","documentation":"Error \"Attachment '{path}' is {file_size} bytes; exceeds inline limit of {self.MAX_INLINE_FILE_BYTES} bytes\" thrown in OpenBMB/ChatDev.","triggerScenarios":"Thrown at runtime/node/agent/providers/openai_provider.py:778 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":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}