hermes - 💡(How to fix) Fix feat: Extension point for registering custom Slack Block Kit action handlers

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Currently, there is no non-invasive way to register custom Slack Block Kit action handlers (button clicks, menu selections, etc.) in the Slack platform adapter (gateway/platforms/slack.py). Any feature that needs to respond to interactive component actions — such as approval flows, archive confirmations, or custom workflows — requires directly modifying the core adapter code.

Root Cause

Currently, there is no non-invasive way to register custom Slack Block Kit action handlers (button clicks, menu selections, etc.) in the Slack platform adapter (gateway/platforms/slack.py). Any feature that needs to respond to interactive component actions — such as approval flows, archive confirmations, or custom workflows — requires directly modifying the core adapter code.

Fix Action

Fix / Workaround

We built a custom "archive approval" workflow that sends Block Kit cards with approve/discard buttons. Responding to these button clicks requires listening for approve_tdai_archive and discard_tdai_archive action IDs. Without an extension point, we had to patch slack.py directly — which will break on upgrades.

Code Example

# gateway/platforms/slack.py, lines ~666-682
for _action_id in ("hermes_approve_once", ...):
    self._app.action(_action_id)(self._handle_approval_action)

for _action_id in ("hermes_confirm_once", ...):
    self._app.action(_action_id)(self._handle_slash_confirm_action)

---

from gateway.slack_actions import slack_action_registry

slack_action_registry.register(
    action_ids=["approve_tdai_archive", "discard_tdai_archive"],
    handler=handle_archive_action,
)
RAW_BUFFERClick to expand / collapse

Summary

Currently, there is no non-invasive way to register custom Slack Block Kit action handlers (button clicks, menu selections, etc.) in the Slack platform adapter (gateway/platforms/slack.py). Any feature that needs to respond to interactive component actions — such as approval flows, archive confirmations, or custom workflows — requires directly modifying the core adapter code.

Problem

The existing action handler registrations are hardcoded inside SlackAdapter.connect():

# gateway/platforms/slack.py, lines ~666-682
for _action_id in ("hermes_approve_once", ...):
    self._app.action(_action_id)(self._handle_approval_action)

for _action_id in ("hermes_confirm_once", ...):
    self._app.action(_action_id)(self._handle_slash_confirm_action)

To add a new action handler (e.g., for a custom approval workflow), users must:

  1. Add self._app.action(action_id)(handler) in the connect() method
  2. Add the handler method to SlackAdapter

This is an invasive modification that will conflict on every git pull upgrade.

Existing Extension Points (insufficient)

Extension PointWhy It Doesn't Work
gateway/hooks.py (Event Hook System)Fires lifecycle events (gateway:startup, session:start, etc.) — does not expose the Bolt App instance for registering action handlers
gateway/platform_registry.pyRegisters new platform adapters, cannot extend existing ones
gateway/builtin_hooks/Extension point for event hooks, not Bolt action registrations
PluginsCan register new platforms, cannot inject action handlers into existing adapters

Proposed Solution

Add an extension mechanism for Slack interactive component handlers. Possible approaches:

Option A: Expose the Bolt App via lifecycle hook

Extend the gateway:startup hook context to include a reference to active platform adapters, allowing plugins/hooks to call adapter.app.action(...) after connection.

Option B: Dedicated action handler registry

Create a lightweight registry (similar to platform_registry.py) specifically for Slack action handlers:

from gateway.slack_actions import slack_action_registry

slack_action_registry.register(
    action_ids=["approve_tdai_archive", "discard_tdai_archive"],
    handler=handle_archive_action,
)

Option C: Plugin hook in SlackAdapter.connect()

Add a _post_connect_hook() method that plugins can override to register additional actions after the Bolt app is initialized.

Use Case

We built a custom "archive approval" workflow that sends Block Kit cards with approve/discard buttons. Responding to these button clicks requires listening for approve_tdai_archive and discard_tdai_archive action IDs. Without an extension point, we had to patch slack.py directly — which will break on upgrades.

Environment

  • Hermes Agent: latest (main branch)
  • Platform: macOS 26.5
  • Python: 3.11 (venv)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix feat: Extension point for registering custom Slack Block Kit action handlers