{"record":{"id":"572101cffa3fc72a","repo":"HKUDS/nanobot","slug":"channel-plugin-setup-must-be-a-channelsetupspec-or","errorCode":null,"errorMessage":"channel plugin setup must be a ChannelSetupSpec or None","messagePattern":"channel plugin setup must be a ChannelSetupSpec or None","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/plugin.py","lineNumber":53,"sourceCode":"    setup: ChannelSetupSpec | None = None\n    management: ChannelManagementSpec = ChannelManagementSpec()\n    dependencies: tuple[str, ...] = ()\n    default_enabled: bool = False\n    settings_visible: bool = True\n    capabilities: frozenset[str] = frozenset()\n    webui: str | None = None\n\n    def __post_init__(self) -> None:\n        if _CHANNEL_PACKAGE_NAME.fullmatch(self.name) is None:\n            raise ValueError(\n                \"channel plugin name must start with a letter and contain only letters, \"\n                \"digits, or underscores\"\n            )\n        _target_parts(self.runtime, label=\"runtime\")\n        if self.connector is not None:\n            _target_parts(self.connector, label=\"connector\")\n        if self.setup is not None and not isinstance(cast(object, self.setup), ChannelSetupSpec):\n            raise TypeError(\"channel plugin setup must be a ChannelSetupSpec or None\")\n        if not isinstance(cast(object, self.management), ChannelManagementSpec):\n            raise TypeError(\"channel plugin management must be a ChannelManagementSpec\")\n        if not isinstance(cast(object, self.dependencies), tuple) or not all(\n            isinstance(cast(object, requirement), str) and requirement.strip()\n            for requirement in self.dependencies\n        ):\n            raise TypeError(\"channel plugin dependencies must be a tuple of requirements\")\n        for dependency in self.dependencies:\n            try:\n                Requirement(dependency)\n            except InvalidRequirement as exc:\n                raise ValueError(\n                    f\"channel plugin dependency is not a valid requirement: {dependency}\"\n                ) from exc\n        if self.webui is not None:\n            webui = self.webui.replace(\"\\\\\", \"/\")\n            if webui.startswith(\"/\") or \"..\" in webui.split(\"/\"):\n                raise ValueError(\"channel plugin webui entry must stay inside its package\")","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/plugin.py#L35-L71","documentation":"Error \"channel plugin setup must be a ChannelSetupSpec or None\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/plugin.py:53 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"}