HKUDS/nanobot · error · ValueError

Slack target user handle is empty

Error message

Slack target user handle is empty

What it means

Error "Slack target user handle is empty" thrown in HKUDS/nanobot.

Source

Thrown at nanobot/channels/slack/runtime.py:343

                        self._target_cache[cache_key] = channel_id
                        return channel_id
            response_metadata = cast(
                dict[str, Any],
                response.get("response_metadata") or {},
            )
            cursor = str(response_metadata.get("next_cursor") or "").strip()
            if not cursor:
                break

        raise ValueError(
            f"Slack channel '{name}' was not found. Use a joined channel name like "
            f"'#general' or a concrete channel ID."
        )

    async def _resolve_user_handle(self, handle: str) -> str:
        normalized = self._normalize_target_name(handle)
        if not normalized:
            raise ValueError("Slack target user handle is empty")

        cache_key = f"user:{normalized}"
        if cache_key in self._target_cache:
            return self._target_cache[cache_key]

        cursor: str | None = None
        web_api = self._require_web_api()
        while True:
            response = cast(
                dict[str, Any],
                await web_api.users_list(limit=200, cursor=cursor),
            )
            for member_value in cast(list[object], response.get("members", [])):
                member = cast(dict[str, Any], member_value)
                if self._member_matches_handle(member, normalized):
                    user_id = str(member.get("id") or "")
                    if not user_id:
                        continue

View on GitHub (pinned to 42f37dc4c0)

When it happens

Trigger: Thrown at nanobot/channels/slack/runtime.py:343 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/f254a01d8f5028c2. Report an issue: GitHub.