Skip to content

feat: tool registry#1439

Draft
srtaalej wants to merge 15 commits intomainfrom
feat-tool-registry
Draft

feat: tool registry#1439
srtaalej wants to merge 15 commits intomainfrom
feat-tool-registry

Conversation

@srtaalej
Copy link
Contributor

Summary

  • Add Tools registry class for registering, executing, and exporting tool handlers in the agent module
  • Support decorator (@tools.add("name")) and programmatic registration with auto-introspection of handler signatures into JSON Schema
  • execute() dispatches to handlers with task_update status lifecycle via ChatStream
  • schema() exports definitions in OpenAI and Anthropic formats

Testing

  • 39 new unit tests in tests/slack_bolt/agent/test_tools.py
  • Existing agent and scenario tests still pass

Category

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

mwbrooks and others added 15 commits February 9, 2026 21:21
…ependency

AsyncBoltAgent imports AsyncWebClient which requires aiohttp. Eagerly
importing it from the agent package __init__ breaks environments where
aiohttp is not installed, since slack_bolt/__init__.py imports BoltAgent
from this package. Follows the existing convention of not adding async
module imports at the top level.
…7 compat

Replace AsyncMock usage with coroutine-returning MagicMock wrappers,
matching the pattern used in the sync test suite. This avoids the
Python 3.8+ AsyncMock and the need for the mock backport package.
    Adds a custom ExperimentalWarning (subclass of FutureWarning) that is
    emitted when a listener explicitly requests the `agent` argument,
    informing developers that this feature is experimental and subject to
    change.

    Co-Authored-By: William Bergamin <wbergamin@salesforce.com>
Split agent tests so unit tests live in tests/slack_bolt/agent/ and
tests/slack_bolt_async/agent/, matching the existing convention where
test directories mirror the source layout. Integration tests that
dispatch through App remain in scenario_tests/.
@srtaalej srtaalej self-assigned this Feb 13, 2026
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 94.47853% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.68%. Comparing base (868cedb) to head (0bf9394).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
slack_bolt/agent/agent.py 90.47% 2 Missing ⚠️
slack_bolt/agent/async_agent.py 90.47% 2 Missing ⚠️
slack_bolt/agent/tools.py 97.33% 2 Missing ⚠️
slack_bolt/app/app.py 66.66% 1 Missing ⚠️
slack_bolt/kwargs_injection/async_utils.py 87.50% 1 Missing ⚠️
slack_bolt/kwargs_injection/utils.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1439      +/-   ##
==========================================
+ Coverage   90.54%   90.68%   +0.13%     
==========================================
  Files         222      227       +5     
  Lines        7129     7286     +157     
==========================================
+ Hits         6455     6607     +152     
- Misses        674      679       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants