feat(integration): WS0-WS5 + activation wiring (context_provider + /new-task) #47
1 changed files with 15 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Reference in a new issue