feat(integration): WS0-WS5 + activation wiring (context_provider + /new-task) #47

Merged
amoussa1229 merged 13 commits from feat/ws-activation-wiring into main 2026-06-23 19:50:29 +00:00
Showing only changes of commit 0945d60338 - Show all commits

View file

@ -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()