HKUDS/nanobot · error · TypeError
ChannelPlugin.management.instance_specs for
Error message
ChannelPlugin.management.instance_specs for '{plugin.name}' must return an iterable What it means
Raised by channel_instance_specs when a plugin supplies an instance_specs management factory but its return value is not iterable. The plugin violates the dependency-free management adapter contract; spec expansion for that channel aborts.
Solutions
- Fix the plugin's instance_specs to return a list of ChannelInstanceSpec
- Omit the instance_specs factory to use the built-in default expansion
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nanobot/channels/contracts.py:342 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/2ce23e5dc98743fc.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/channels/contracts.py:342
def channel_instance_specs(
plugin: ChannelPlugin,
section: Any,
*,
enabled_only: bool = True,
) -> list[ChannelInstanceSpec]:
"""Expand persisted config through the dependency-free management adapter."""
factory = plugin.management.instance_specs
if factory is None:
activation = ChannelActivation.from_config(section)
raw_specs: object = (
[]
if enabled_only and not activation.resolve(default=plugin.default_enabled)
else [ChannelInstanceSpec(instance_id="default", config=section)]
)
else:
raw_specs = cast(object, factory(section, enabled_only=enabled_only))
if not isinstance(raw_specs, Iterable):
raise TypeError(
f"ChannelPlugin.management.instance_specs for '{plugin.name}' must return an iterable"
)
specs = list(cast(Iterable[object], raw_specs))
if not _all_channel_instance_specs(specs):
raise TypeError(
f"ChannelPlugin.management.instance_specs for '{plugin.name}' returned an invalid item"
)
instance_ids: set[str] = set()
runtime_names: set[str] = set()
for spec in specs:
instance_id = cast(object, spec.instance_id)
if not isinstance(instance_id, str) or not instance_id.strip():
raise ValueError(
f"ChannelPlugin.management.instance_specs for '{plugin.name}' returned an empty instance id"
)
if spec.instance_id in instance_ids:
raise ValueError(View on GitHub (pinned to 42f37dc4c0)