{"record":{"id":"34c29b9da9c68d94","repo":"HKUDS/nanobot","slug":"channelplugin-management-update-instance-config-fo","errorCode":null,"errorMessage":"ChannelPlugin.management.update_instance_config for '{plugin.name}' must return a dict","messagePattern":"ChannelPlugin\\.management\\.update_instance_config for '(.+?)' must return a dict","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/contracts.py","lineNumber":434,"sourceCode":"        copied_config[cast(str, key)] = value\n    return copied_config\n\n\ndef channel_update_instance_config(\n    plugin: ChannelPlugin,\n    section: Any,\n    values: dict[str, Any],\n    *,\n    instance_id: str = \"default\",\n) -> dict[str, Any]:\n    updater = plugin.management.update_instance_config\n    if updater is None:\n        if instance_id not in {\"\", \"default\"}:\n            raise ValueError(f\"{plugin.name} does not support multiple instances\")\n        return values\n    updated = cast(object, updater(section, values, instance_id=instance_id))\n    if not isinstance(updated, dict):\n        raise TypeError(f\"ChannelPlugin.management.update_instance_config for '{plugin.name}' must return a dict\")\n    return cast(dict[str, Any], updated)\n\n\ndef channel_set_config_enabled(\n    plugin: ChannelPlugin,\n    section: Any,\n    enabled: bool,\n    *,\n    instance_id: str = \"default\",\n) -> dict[str, Any]:\n    \"\"\"Toggle one instance while preserving channel-owned config shape.\"\"\"\n    from nanobot.config.loader import merge_missing_defaults\n\n    values = channel_instance_config(plugin, section, instance_id=instance_id)\n    values = cast(dict[str, Any], merge_missing_defaults(values, channel_default_config(plugin)))\n    values[\"enabled\"] = enabled\n    return channel_update_instance_config(\n        plugin,","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/contracts.py#L416-L452","documentation":"Error \"ChannelPlugin.management.update_instance_config for '{plugin.name}' must return a dict\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/contracts.py:434 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"}