Use enabled plugin paths for subagent paths

Replace iteration over all plugins and plugins.find_plugin_dir() with plugins.get_enabled_plugin_paths(agent) and files.get_abs_path(...). This limits path collection to enabled plugins for the given agent, uses a centralized path resolution helper, and preserves existing behavior of checking existence (or honoring must_exist_completely) and avoiding duplicate entries.

frdel committed Feb 25, 2026 at 08:49 UTC 84460232ca88cf109d6bb3de4ac6fb5f233b9cb3
1 file changed +2 -5
python/helpers/subagents.py
+2 -5
@@ -399,11 +399,8 @@ def get_paths(
399 # plugins/*/subpaths...
400 from python.helpers import plugins
401
402 - for plugin in plugins.get_plugins_list():
403 - plugin_dir = plugins.find_plugin_dir(plugin)
404 - if not plugin_dir:
405 - continue
406 - path = os.path.join(plugin_dir, *subpaths)
402 + for plugin_dir in plugins.get_enabled_plugin_paths(agent):
403 + path = files.get_abs_path(plugin_dir, *subpaths)
404 if (not must_exist_completely) or files.exists(path):
405 if path not in paths:
406 paths.append(path)