Skip to content

fix(plugins): reject a plugin tool whose name is already registered - #6139

Open
AnnasMazhar wants to merge 1 commit into
strands-agents:mainfrom
AnnasMazhar:fix/6099-plugin-tool-name-conflict
Open

AnnasMazhar wants to merge 1 commit into
strands-agents:mainfrom
AnnasMazhar:fix/6099-plugin-tool-name-conflict

Conversation

@AnnasMazhar

Copy link
Copy Markdown
Contributor

Fixes #6099

A second plugin instance silently replaced the first instance's @tool. _PluginRegistry._register_tools calls ToolRegistry.process_tools, and register_tool skips its duplicate-name check for hot-reloadable tools (registry.py:250). Every @tool decorated function is hot-reloadable, so the check never fires and the second plugin's tool overwrites the first one. This matches TypeScript, which throws Tool with name 'ping' already registered (tool-registry.ts:35).

  • registry.py: _PluginRegistry tracks which plugin registered each tool name and rejects a plugin tool whose name is already taken by a different tool; re-registering the same plugin's own tool is still allowed.
  • tests: new test_plugin_tool_conflicts.py covering the duplicate-plugin case, collision with an already registered agent tool, and same-plugin re-registration.

Tests: pytest strands-py/tests/strands/plugins - 88 passed.

@AnnasMazhar
AnnasMazhar requested a review from a team as a code owner November 13, 2026 17:33
@github-actions github-actions Bot added area-hooks Features or requests that might be implementable via hooks area-tool Tool behavior/api bug Something isn't working python Pull requests that update python code labels Nov 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-hooks Features or requests that might be implementable via hooks area-tool Tool behavior/api bug Something isn't working python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Python: a second plugin instance silently overwrites the first instance's @tool

1 participant