Skip to main content

agent_session_stopped event

A user clicked the stop button on an agent session

Facts

Required Scopes
Compatible APIs

Usage info

Slack sends the agent_session_stopped event when a user clicks the native stop button shown while an agent session is in the processing status. While your app is not subscribed, agents.sessions.setStatus returns a missing_agent_session_stopped_event_subscription warning and the user sees a non-interactive loading indicator instead. Subscribe to the event so users can stop your agent.

When you receive this event, your app should:

  1. Stop any in-progress work for the given channel and thread.
  2. Clean up resources and confirm to the user that work has stopped.
  3. Transition the session away from processing using either agents.sessions.setStatus or chat.stopStream.

The session status does not update automatically when the user clicks stop. Your app is responsible for transitioning the status.

{
"channel": "C0123ABC456",
"event_ts": "1783536983.783769",
"streaming_message_ts": ["1782234987.693923"],
"thread_ts": "1782234671.392669",
"type": "agent_session_stopped",
"user": "U123ABC456"
}

The streaming_message_ts array lists the timestamps of your app's in-progress streaming messages that Slack stopped in response to the click. It is an empty array when no stream was active, so the event still tells you to stop work that isn't a stream. As with all Events API deliveries, team_id is on the enclosing event_callback envelope rather than in the event itself.

See Stopping a session for the full flow.