Skip to content

Add assistant middleware inheritance option#1519

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

Add assistant middleware inheritance option#1519
Cr1stal wants to merge 5 commits into
slackapi:mainfrom
Cr1stal:feature/issue-1346-assistant-middleware

Conversation

@Cr1stal
Copy link
Copy Markdown

@Cr1stal Cr1stal commented May 31, 2026

Summary

Adds an opt-in auto_inherit_app_middleware option for Assistant and AsyncAssistant.

When this option is enabled, Assistant handlers are registered as normal App listeners instead of running inside the Assistant middleware's private listener dispatch. This lets assistant-specific handlers participate in the same global middleware pipeline as other app listeners while preserving the existing default behavior for Assistant().

This addresses #1346 by allowing app-level authorization, auditing, rate limiting, or enrichment middleware to affect assistant flows. Assistant listeners are inserted into an app-level priority block before catch-all listeners, and the priority block preserves registration order when multiple assistants are registered.

The implementation keeps sync and async behavior mirrored and keeps assistant-specific listener middleware responsible for attaching assistant helpers.

Testing

  • ./scripts/format.sh --no-install
  • ./scripts/lint.sh --no-install
  • ./scripts/run_tests.sh tests/slack_bolt/app/test_app_assistant_middleware.py
  • ./scripts/run_mypy.sh --no-install
  • ./scripts/install_all_and_run_tests.sh (920 passed, 81 warnings; mypy: Success: no issues found in 234 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 have read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I have read and agree to the Code of Conduct.
  • I have 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
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