{"record":{"id":"2825b67bf818355c","repo":"OpenBMB/ChatDev","slug":"failed-to-persist-attachment-attachment-name-or","errorCode":null,"errorMessage":"Failed to persist attachment '{attachment.name or attachment.attachment_id}': {exc}","messagePattern":"Failed to persist attachment '(.+?)': (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"runtime/node/executor/agent_executor.py","lineNumber":1083,"sourceCode":"            return default_limit\n        custom_limit = model.params.get(\"tool_loop_limit\")\n        if isinstance(custom_limit, int) and custom_limit > 0:\n            return custom_limit\n        return default_limit\n\n    def _persist_message_attachments(self, message: Message, node_id: str) -> None:\n        \"\"\"Register attachments produced by model outputs to the attachment store.\"\"\"\n        store = self.context.global_state.get(\"attachment_store\")\n        if store is None:\n            return\n        for block in message.blocks():\n            attachment = block.attachment\n            if not attachment:\n                continue\n            try:\n                self._persist_single_attachment(store, block, node_id)\n            except Exception as exc:\n                raise RuntimeError(f\"Failed to persist attachment '{attachment.name or attachment.attachment_id}': {exc}\") from exc\n\n    def _persist_single_attachment(self, store: Any, block: MessageBlock, node_id: str) -> None:\n        attachment = block.attachment\n        if attachment is None:\n            return\n        if attachment.remote_file_id and not attachment.data_uri and not attachment.local_path:\n            record = store.register_remote_file(\n                remote_file_id=attachment.remote_file_id,\n                name=attachment.name or attachment.attachment_id or \"remote_file\",\n                mime_type=attachment.mime_type,\n                size=attachment.size,\n                kind=block.type,\n                attachment_id=attachment.attachment_id,\n            )\n            block.attachment = record.ref\n            return\n\n        workspace_root = self.context.global_state.get(\"python_workspace_root\")","sourceCodeStart":1065,"sourceCodeEnd":1101,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/runtime/node/executor/agent_executor.py#L1065-L1101","documentation":"Wrapping error from _persist_message_attachments: writing a message attachment to the workspace/attachment store raised an unexpected exception (I/O error, registration failure, bad data URI). The original exception is chained via 'from exc'.","triggerScenarios":"Any exception while persisting an attachment block: unwritable workspace directory, corrupt data_uri, store.register_file failure, permission errors during copy2.","commonSituations":"Read-only or full disk workspace; container missing volume mount; attachment uploaded as a data URI that fails decoding; store backend (DB/object store) outage mid-run.","solutions":["Inspect the chained __cause__ exception — it carries the real failure","Verify python_workspace_root in context.global_state is writable and mounted","Check the attachment has valid local_path/data_uri/data_bytes before executing the node","Retry after fixing storage; persist attachments before generating long conversations"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import os\nassert os.access(workspace_root, os.W_OK), 'workspace not writable'","typeGuard":null,"tryCatchPattern":"try:\n    executor.execute(node, inputs)\nexcept RuntimeError as e:\n    if 'Failed to persist attachment' in str(e):\n        cause = e.__cause__  # real storage failure\n        ...","preventionTips":["Health-check workspace writability before long runs","Keep disk/volume capacity monitoring on the workspace dir"],"tags":["attachments","persistence","io"],"backgroundTag":"file-persistence-failed","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}