Repository navigation
feat(tools): add Python tool registry removal - #5444
Merged
Merged
Conversation
ikenyal
marked this pull request as ready for review
October 22, 2026 20:03
liramon2
reviewed
Oct 23, 2026
Contributor
|
@ikenyal Hi, thanks for the contribution. I left a couple comments on this PR. |
liramon2
approved these changes
Oct 26, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 29, 2026
gautamsirdeshmukh
pushed a commit
to gautamsirdeshmukh/harness-sdk
that referenced
this pull request
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human Overview
I wanted callers to remove tools without having to keep the registry’s internal dictionaries in sync themselves. This change adds the same removal API available in TypeScript and uses it for Swarm and structured-output cleanup, while keeping missing-tool removal a no-op.
Description
Removing a Python tool currently requires callers to keep two dictionaries in sync. A public removal method prevents tools from remaining available through a stale dynamic registration and brings Python into parity with TypeScript.
Public API Changes
The existing
strands.tools.registry.ToolRegistrygainsremove(tool_name: str) -> None. It removes the exact registered name from both regular and dynamic tools; missing names are a no-op.Related Issues
Resolves #5323.
Documentation PR
The new method's docstring documents its contract. A before/after usage example is included in Public API Changes above. The generated Python API reference was verified locally; no separate guide change is needed.
Type of Change
New feature
Testing
Before review cleanup, pre-push checks passed: lint, mypy, Python 3.12 coverage (7,836 passed, 38 skipped), 100 related tests on Python 3.10, build, complexity, API generation, and a built-wheel smoke test. After the documentation/test-only cleanup, all 99 remaining related tests, scoped Ruff formatting/lint, and API generation passed. AST comparison confirms production logic is unchanged. The full suite was not rerun for this revision. No real-provider integration tests were run.
hatch run prepareThe local checks above were run instead;
preparealso runs the full Python-version matrix, which is left to CI.Additional Details
Scope and validation notes
As agreed in #5323, this updates Swarm and structured-output cleanup on main. Graph remains in the separate, unmerged #5131; its call site can adopt this method according to merge order. There is no dependency on that PR and no change to connection/provider lifecycle management.
The affected tests emit the same warnings as unmodified main. API generation also reports the same two existing unresolved references in
strands.tools.decoratoron main. The full suite retains its existing deprecation and mock-coroutine warnings.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.