HKUDS/nanobot · error · ValueError

channel plugin {label} must use 'module:attribute' syntax

Error message

channel plugin {label} must use 'module:attribute' syntax

What it means

Error "channel plugin {label} must use 'module:attribute' syntax" thrown in HKUDS/nanobot.

Source

Thrown at nanobot/channels/plugin.py:119

        module = importlib.import_module(module_name)
        factory = getattr(module, attr_name, None)
        if not callable(factory):
            raise ImportError(
                f"Channel plugin '{self.name}' connector '{self.connector}' is not callable"
            )
        connector = factory()
        if not callable(getattr(connector, "handle", None)):
            raise ImportError(
                f"Channel plugin '{self.name}' connector '{self.connector}' "
                "does not provide handle()"
            )
        return connector


def _target_parts(target: str, *, label: str) -> tuple[str, str]:
    module_name, separator, attr_name = target.partition(":")
    if not separator or not module_name or not attr_name:
        raise ValueError(f"channel plugin {label} must use 'module:attribute' syntax")
    if not all(part.isidentifier() for part in module_name.split(".")):
        raise ValueError(f"channel plugin {label} module must be an absolute import path")
    if not attr_name.isidentifier():
        raise ValueError(f"channel plugin {label} attribute must be a Python identifier")
    return module_name, attr_name


def has_channel_package(name: str) -> bool:
    """Return whether *name* owns a dependency-free package manifest."""
    if _CHANNEL_PACKAGE_NAME.fullmatch(name) is None:
        return False
    return files("nanobot.channels").joinpath(name, "manifest.py").is_file()


@lru_cache(maxsize=None)
def load_channel_package(name: str) -> ChannelPlugin | None:
    """Load one package manifest without importing its runtime."""
    if not has_channel_package(name):

View on GitHub (pinned to 42f37dc4c0)

When it happens

Trigger: Thrown at nanobot/channels/plugin.py:119 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/e25b674a639acd4a. Report an issue: GitHub.