diff --git a/agent-team/agent_team/transport/slack_listener.py b/agent-team/agent_team/transport/slack_listener.py index a35b305..7df310d 100644 --- a/agent-team/agent_team/transport/slack_listener.py +++ b/agent-team/agent_team/transport/slack_listener.py @@ -523,6 +523,21 @@ class SlackListener: def _on_mention(body: Mapping[str, Any]) -> None: _forward(body) + # Slash commands (e.g. /new-task) MUST be ack()'d within ~3s or Slack + # shows "the app did not respond". Bolt delivers the INNER command + # payload (command / text / user_id / channel_id) WITHOUT the Socket + # Mode envelope's ``type``, so re-stamp ``type: "slash_commands"`` to + # match what handle_event's _is_new_task_command + _discriminating_type + # expect, then forward (handle_event runs AUTHZ-01 + the new-task + # dispatch). Ack FIRST so the 3s deadline is met even though start_task + # then runs the clarifier to the first gate synchronously. + @app.command(_NEW_TASK_COMMAND) + def _on_command(ack: Any, body: Mapping[str, Any]) -> None: + ack() + payload = dict(body) + payload.setdefault("type", "slash_commands") + _forward(payload) + handler = SocketModeHandler(app, self._app_token) self._socket_handler = handler handler.start()