{"record":{"id":"e411df414f731122","repo":"HKUDS/nanobot","slug":"dingtalk-attachment-fallback-was-not-delivered","errorCode":null,"errorMessage":"DingTalk attachment fallback was not delivered","messagePattern":"DingTalk attachment fallback was not delivered","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/dingtalk/runtime.py","lineNumber":789,"sourceCode":"            )\n            if msg.chat_id.startswith(\"group:\") and safe_sender_name:\n                content = f\"# @{safe_sender_name}\\n\\n{content}\"\n            if not await self._send_markdown_text(token, msg.chat_id, content):\n                raise RuntimeError(\"DingTalk text message was not delivered\")\n\n        for media_ref in msg.media or []:\n            ok = await self._send_media_ref(token, msg.chat_id, media_ref)\n            if ok:\n                continue\n            self.logger.error(\"media send failed for {}\", media_ref)\n            # Send visible fallback so failures are observable by the user.\n            filename = self._guess_filename(media_ref, self._guess_upload_type(media_ref))\n            if not await self._send_markdown_text(\n                token,\n                msg.chat_id,\n                f\"[Attachment send failed: {filename}]\",\n            ):\n                raise RuntimeError(\"DingTalk attachment fallback was not delivered\")\n\n    async def _on_message(\n        self,\n        content: str,\n        sender_id: str | None,\n        sender_name: str,\n        conversation_type: str | None = None,\n        conversation_id: str | None = None,\n    ) -> None:\n        \"\"\"Handle incoming message (called by NanobotDingTalkHandler).\n\n        Delegates to BaseChannel._handle_message() which enforces allow_from\n        permission checks before publishing to the bus.\n        \"\"\"\n        try:\n            self.logger.info(\"inbound: {} from {}\", content, sender_name)\n            if not sender_id:\n                self.logger.warning(\"dropping DingTalk message without a sender ID\")","sourceCodeStart":771,"sourceCodeEnd":807,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/dingtalk/runtime.py#L771-L807","documentation":"Error \"DingTalk attachment fallback was not delivered\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/dingtalk/runtime.py:789 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"}