Skip to content

The agent that grows with you

fix(slack): /pause is handed over before any Slack lookup

Tekniume817ac8c8e8b
diff --git a/plugins/platforms/slack/adapter.py b/plugins/platforms/slack/adapter.py
index 727e9af4271..95cb97c839a 100644
--- a/plugins/platforms/slack/adapter.py
+++ b/plugins/platforms/slack/adapter.py
@@ -6092,12 +6092,12 @@ class SlackAdapter(BasePlatformAdapter):
auto_skill=resolve_channel_skills(self.config.extra, channel_id, None))
# A slash turn is a human turn: it re-pins the channel prompt and session context, so it
# must carry the same names as a message here or the next message flips them. A command
- # that interrupts or unblocks the running turn starts none of its own, and a slow
- # users.info must not hold /stop back while the worker keeps running.
+ # that interrupts, unblocks or pauses work starts no turn of its own, and a slow
+ # users.info must not hold /stop or /pause back while the worker keeps running.
from hermes_cli.commands import resolve_command
cmd = resolve_command(event.get_command() or "")
controls_running_turn = cmd is not None and (
- cmd.busy_policy == "interrupt_then_dispatch" or cmd.name in ("approve", "deny"))
+ cmd.busy_policy == "interrupt_then_dispatch" or cmd.name in ("approve", "deny", "pause"))
if not rejected and not controls_running_turn:
source.chat_name = await self._resolve_channel_name(channel_id, team_id=team_id)
source.user_name = await self._resolve_user_name(user_id, chat_id=channel_id, team_id=team_id)
diff --git a/tests/plugins/platforms/slack/test_slash_command_channel_prompt.py b/tests/plugins/platforms/slack/test_slash_command_channel_prompt.py
index cc909eaff7d..77cfd86581f 100644
--- a/tests/plugins/platforms/slack/test_slash_command_channel_prompt.py
+++ b/tests/plugins/platforms/slack/test_slash_command_channel_prompt.py
@@ -63,14 +63,14 @@ async def test_slash_turn_matches_message_turn_prompt_and_names(channel_id, chan
@pytest.mark.asyncio
@pytest.mark.parametrize("channel_id, authorized, command, reaches_runner", [
("C_OPS", False, "/hermes", 0), ("D_ALICE", False, "/hermes", 1),
- ("C_OPS", True, "/stop", 1), ("C_OPS", True, "/approve", 1),
-], ids=["rejected-channel", "rejected-dm", "stop", "approve"])
+ ("C_OPS", True, "/stop", 1), ("C_OPS", True, "/approve", 1), ("C_OPS", True, "/pause", 1),
+], ids=["rejected-channel", "rejected-dm", "stop", "approve", "pause"])
async def test_slash_that_starts_no_turn_costs_no_slack_lookup(channel_id, authorized, command, reaches_runner):
"""The message path rejects an unauthorized sender before any Slack lookup, and the names the
slash path now resolves must not cost one either. In a DM the runner still gets the event,
without names: it answers an unauthorized DM per ``unauthorized_dm_behavior`` (pairing code
or decline), and a slash command there is how an unpaired user gets that answer.
- ``stop`` / ``approve``: a command that interrupts or unblocks the running turn is handed over
+ ``stop`` / ``approve`` / ``pause``: a command that interrupts, unblocks or pauses work is handed over
before any lookup. A cold ``users.info`` for a second operator must not hold ``/stop`` back
while the worker keeps running."""
adapter = _adapter(channel_id)