{"record":{"id":"493a4a4e4120c086","repo":"HKUDS/nanobot","slug":"source-session-was-not-found","errorCode":null,"errorMessage":"source session was not found","messagePattern":"source session was not found","errorType":"exception","errorClass":"SessionMessageError","httpStatus":null,"severity":"error","filePath":"nanobot/agent/tools/session_messages.py","lineNumber":229,"sourceCode":"        content: str,\n        expect_reply: bool,\n        reply_timeout_seconds: int | None = None,\n    ) -> str:\n        timeout_seconds = self._validate_reply_timeout(expect_reply, reply_timeout_seconds)\n        try:\n            target_name = normalize_session_handle(target_handle)\n        except ValueError as exc:\n            raise SessionMessageError(str(exc)) from exc\n        target = await asyncio.to_thread(self._handles.resolve, target_name)\n        if target is None:\n            raise SessionMessageError(f\"session @{target_name} was not found\")\n\n        source = await asyncio.to_thread(\n            self._handles.handle_for_session,\n            source_session_key,\n        )\n        if source is None:\n            raise SessionMessageError(\"source session was not found\")\n        envelope: SessionMessageEnvelope = {\n            \"message_id\": uuid4().hex,\n            \"created_at_ms\": int(time.time() * 1000),\n            \"expect_reply\": expect_reply,\n            \"source_handle\": source.name,\n            \"source_session_key\": source.session_key,\n            \"target_session_key\": target.session_key,\n        }\n        reverse_wait_key = (target.session_key, source.session_key)\n        wait_key = (source.session_key, target.session_key)\n\n        async with self._send_lock:\n            now = self._clock()\n            sent_at = self._sent_at.setdefault(source.session_key, deque())\n            cutoff = now - _RATE_LIMIT_WINDOW_SECONDS\n            while sent_at and sent_at[0] <= cutoff:\n                sent_at.popleft()\n            if len(sent_at) >= self._max_messages_per_minute:","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/agent/tools/session_messages.py#L211-L247","documentation":"Raised by SessionMessageManager.enqueue when the resolver cannot find the source session that is sending the message. The sending agent's session has ended (or its key is unregistered), so no reply routing or rate-limit bucket can be attached.","triggerScenarios":"Thrown at nanobot/agent/tools/session_messages.py:229 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the sending session alive until after the enqueue completes","Re-register or restart the sending session and retry the send"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","contentChangedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}