fix(command_manager): 修复插件卸载时元信息移除不精确的问题

修复 CommandManager 中 unload_plugin 方法移除插件元信息时使用 startswith 导致可能误删其他插件的问题,改为精确匹配
同时调整相关测试用例验证精确匹配行为
This commit is contained in:
2026-01-09 04:37:49 +08:00
parent 3235e7bae8
commit cbea484f38
5 changed files with 75 additions and 9 deletions

View File

@@ -93,7 +93,7 @@ class CommandManager:
self.request_handler.unregister_by_plugin_name(plugin_name)
# 移除插件元信息
plugins_to_remove = [name for name in self.plugins if name.startswith(plugin_name)]
plugins_to_remove = [name for name in self.plugins if name == plugin_name]
for name in plugins_to_remove:
del self.plugins[name]