Mark the relay Slack adapter as drawing buttons

It sends Block Kit buttons but lacked the new flag, so mirrored prompts would fall back to text.
Covered by a gateway test over both Slack adapters and Telegram.
This commit is contained in:
Rohit C Prasad
2026-10-25 15:18:00 -07:00
parent 05d0afa5dd
commit 33eb0c1a85
2 changed files with 18 additions and 0 deletions
+1
View File
@@ -230,6 +230,7 @@ class RelayHub:
class SlackRelayAdapter(BasePlatformAdapter):
platform = "slack"
supports_interactive = True # Block Kit buttons via `send_interactive`, like the direct adapter
def __init__(
self,
+17
View File
@@ -83,3 +83,20 @@ def test_buttons_still_used_where_the_platform_draws_them(tmp_path):
assert manager.gateway.texts == []
assert len(manager.gateway.interactive_sends) == 1
def test_gateway_knows_which_real_adapters_draw_buttons():
"""Both Slack adapters (Socket Mode and relay) send Block Kit buttons, so the gateway
must advertise them; Telegram falls back to text and must not."""
from coworker.connectors.adapters import SlackAdapter, TelegramAdapter
from coworker.connectors.gateway import Gateway
from coworker.connectors.relay_client import SlackRelayAdapter
assert SlackAdapter.supports_interactive is True
assert SlackRelayAdapter.supports_interactive is True
assert TelegramAdapter.supports_interactive is False
gateway = Gateway()
gateway.register(SlackRelayAdapter("wss://x", lambda: "jwt", teams={}))
assert gateway.supports_interactive("slack:T1:C1") is True
assert gateway.supports_interactive("telegram:12345") is False