{"record":{"id":"fc71de1e95ed3c71","repo":"HKUDS/nanobot","slug":"slack-user-handle-was-not-found-use-name-o","errorCode":null,"errorMessage":"Slack user '{handle}' was not found. Use '@name' or a concrete DM/channel ID.","messagePattern":"Slack user '(.+?)' was not found\\. Use '@name' or a concrete DM/channel ID\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/slack/runtime.py","lineNumber":373,"sourceCode":"            )\n            for member_value in cast(list[object], response.get(\"members\", [])):\n                member = cast(dict[str, Any], member_value)\n                if self._member_matches_handle(member, normalized):\n                    user_id = str(member.get(\"id\") or \"\")\n                    if not user_id:\n                        continue\n                    dm_id = await self._open_dm_for_user(user_id)\n                    self._target_cache[cache_key] = dm_id\n                    return dm_id\n            response_metadata = cast(\n                dict[str, Any],\n                response.get(\"response_metadata\") or {},\n            )\n            cursor = str(response_metadata.get(\"next_cursor\") or \"\").strip()\n            if not cursor:\n                break\n\n        raise ValueError(\n            f\"Slack user '{handle}' was not found. Use '@name' or a concrete DM/channel ID.\"\n        )\n\n    async def _open_dm_for_user(self, user_id: str) -> str:\n        web_api = self._require_web_api()\n        response = cast(\n            dict[str, Any],\n            await web_api.conversations_open(users=user_id),\n        )\n        channel = cast(dict[str, Any], response.get(\"channel\") or {})\n        channel_id = str(channel.get(\"id\") or \"\")\n        if not channel_id:\n            raise ValueError(f\"Slack DM target for user '{user_id}' could not be opened.\")\n        return channel_id\n\n    @staticmethod\n    def _normalize_target_name(value: str) -> str:\n        return value.strip().lstrip(\"#@\").lower()","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/slack/runtime.py#L355-L391","documentation":"Lookup failure in _resolve_user_handle: pagination over users.list exhausted without finding a member matching the handle. Either the handle is mistyped, the user is outside the workspace, or the token cannot see them. The message suggests '@name' or a concrete DM/channel ID instead.","triggerScenarios":"Thrown at nanobot/channels/slack/runtime.py:373 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the handle spelling or use the user ID (starts with 'U' or 'W')","Use a DM channel ID directly to skip user resolution","Ensure the bot token has users:read scope and the user is in the workspace"],"exampleFix":null,"handlingStrategy":"try-catch","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"}