feat(plugins): add MultiAgentPlugin for Swarm and Graph orchestrators#2280
feat(plugins): add MultiAgentPlugin for Swarm and Graph orchestrators#2280zastrowm wants to merge 9 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Issue: This PR introduces a new public class ( Suggestion: Add the |
- Extract _discover_methods generic helper in _discovery.py to eliminate duplication between discover_hooks and discover_tools - Add test_dual_plugin_discover_hooks_called_once to verify the hasattr guard prevents double-discovery in dual inheritance
|
/strands review |
This comment was marked as outdated.
This comment was marked as outdated.
|
Assessment: Approve All review feedback has been addressed. The unused The |
Description
The existing
Pluginsystem only targets individual agents. When building observability, guardrails, or custom behavior for multi-agent orchestrators (Swarm, Graph), there's no composable mechanism — you're forced to manually wire upHookProviderinstances and manage initialization yourself. This PR introducesMultiAgentPlugin, the orchestrator-level counterpart toPlugin, giving orchestrators the same declarative plugin experience that agents already have.Public API Changes
New
MultiAgentPluginbase class (exported fromstrandsandstrands.plugins):Both
SwarmandGraphaccept a newpluginsparameter:A single class can implement both
PluginandMultiAgentPluginfor dual-use across agents and orchestrators:Related Issues
Documentation PR
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.