Skip to main content

discover_plugin_agents

Function discover_plugin_agents 

Source
pub fn discover_plugin_agents(project_root: &Path) -> Vec<AgentConfig>
Expand description

List every plugin agent across every discovered plugin, fully projected and namespaced.

Why: agents::protocol::agents_list’s plugin tier needs the same AgentConfig shape (for description/model in its wire entry) the embedded and disk tiers already produce. What: for each PluginRoot, scans agents_dir via agents::discover_agents (the same .md-only, .toml-warns scan disk agents use), skips any local name agents::protocol::is_base_agent recognizes (a plugin literally shipping base-engineer.md etc. is excluded exactly like the embedded/disk tiers — #3539’s base-filter interaction clause), and loads the rest via [load_plugin_agent]. A load failure is logged at WARN and skipped (never aborts the whole scan), mirroring agents::load_all_agents’s per-file resilience. Sorted by the final namespaced name. Test: tests::discover_plugin_agents_namespaces_entries, tests::discover_plugin_agents_excludes_base_named_agent, tests::discover_plugin_agents_skips_unparseable_agent.