{"record":{"id":"3a6338814f10b30f","repo":"HKUDS/nanobot","slug":"matrix-client-not-initialized","errorCode":null,"errorMessage":"Matrix client not initialized","messagePattern":"Matrix client not initialized","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/matrix/runtime.py","lineNumber":596,"sourceCode":"            return fail\n\n        content = self._build_outbound_attachment_content(\n            filename=filename, mime=mime, size_bytes=size_bytes,\n            mxc_url=mxc_url, encryption_info=encryption_info,\n        )\n        if relates_to:\n            content[\"m.relates_to\"] = relates_to\n        try:\n            await self._send_room_content(room_id, content)\n        except Exception:\n            self.logger.error(\"Matrix room content send failed for room_id={}\", room_id, exc_info=True)\n            return fail\n        return None\n\n    async def send(self, msg: OutboundMessage) -> None:\n        \"\"\"Send outbound content; clear typing for non-progress messages.\"\"\"\n        if not self.client:\n            raise RuntimeError(\"Matrix client not initialized\")\n        text = msg.content or \"\"\n        candidates = self._collect_outbound_media_candidates(msg.media)\n        relates_to = self._build_thread_relates_to(msg.metadata)\n        is_progress = isinstance(msg.event, ProgressEvent)\n        try:\n            failures: list[str] = []\n            if candidates:\n                limit_bytes = await self._effective_media_limit_bytes()\n                for path in candidates:\n                    if fail := await self._upload_and_send_attachment(\n                        room_id=msg.chat_id,\n                        path=path,\n                        limit_bytes=limit_bytes,\n                        relates_to=relates_to,\n                    ):\n                        failures.append(fail)\n            if failures:\n                text = f\"{text.rstrip()}\\n{chr(10).join(failures)}\" if text.strip() else \"\\n\".join(failures)","sourceCodeStart":578,"sourceCodeEnd":614,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/matrix/runtime.py#L578-L614","documentation":"Error \"Matrix client not initialized\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/matrix/runtime.py:596 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"}