fix(plugins): clear _plugin_platform_names on force-rediscover

discover_and_load(force=True) cleared every per-plugin registry except
_plugin_platform_names, which register_platform() populates. A platform
plugin disabled between force-rediscovers left a stale name behind, so the
set diverged from the real platform_registry / _plugins state and never
shrank across repeated force passes.

Add the missing clear() and a regression test that seeds every per-plugin
registry, forces a rediscover, and asserts they all empty (so a future
registry addition can't silently leak across a force pass either).
This commit is contained in:
kshitijk4poor
2026-06-12 10:55:44 +05:30
parent 82d570165e
commit 889a13696b
2 changed files with 45 additions and 0 deletions
+1
View File
@@ -1129,6 +1129,7 @@ class PluginManager:
self._hooks.clear()
self._middleware.clear()
self._plugin_tool_names.clear()
self._plugin_platform_names.clear()
self._cli_commands.clear()
self._plugin_commands.clear()
self._plugin_skills.clear()