Skip to content

Add explicit Assistant listener registration mode#1519

Open
Cr1stal wants to merge 6 commits into
slackapi:mainfrom
Cr1stal:feature/issue-1346-assistant-middleware
Open

Add explicit Assistant listener registration mode#1519
Cr1stal wants to merge 6 commits into
slackapi:mainfrom
Cr1stal:feature/issue-1346-assistant-middleware

Conversation

@Cr1stal
Copy link
Copy Markdown

@Cr1stal Cr1stal commented May 31, 2026

Summary

Addresses #1346 by adding an explicit Assistant registration mode to App.assistant() and AsyncApp.assistant().

By default, app.assistant(assistant) continues to behave as it does today: it registers Assistant as middleware. This preserves the existing Assistant middleware dispatch path and keeps app.use(assistant) / app.middleware(assistant) behavior unchanged.

Apps can now opt into listener-based registration:

app.assistant(assistant, mode="listeners")

In this mode, Assistant handlers are registered as normal App listeners. This lets assistant-specific handlers participate in the App listener pipeline and inherit app-level middleware such as authorization, auditing, rate limiting, or request enrichment.

The PR also adds an internal listener registry so Assistant listeners can be evaluated before broad catch-all listeners without exposing a general listener priority API. Registration order is preserved within Assistant listeners and ordinary App listeners, and sync/async behavior is kept mirrored.

Testing

  • ./scripts/format.sh --no-install
  • ./scripts/lint.sh --no-install
  • ./scripts/run_tests.sh tests/slack_bolt/app/test_app_assistant_middleware.py (14 passed)
  • ./scripts/run_mypy.sh --no-install (Success: no issues found in 235 source files)
  • ./scripts/install_all_and_run_tests.sh (924 passed, 81 warnings; mypy: Success: no issues found in 235 source files)

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.

@Cr1stal Cr1stal force-pushed the feature/issue-1346-assistant-middleware branch from ee9fb84 to 18fae4a Compare May 31, 2026 05:59
@Cr1stal Cr1stal changed the title [codex] Add assistant middleware inheritance option Add assistant middleware inheritance option May 31, 2026
@Cr1stal Cr1stal marked this pull request as ready for review May 31, 2026 08:06
@Cr1stal Cr1stal requested a review from a team as a code owner May 31, 2026 08:06
@Cr1stal Cr1stal changed the title Add assistant middleware inheritance option Add explicit Assistant listener registration mode May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant