v2
chat
chat

Cancel Session Task

Changed on

Cancel an in-flight task for a session.

Handles both lifecycle states uniformly:

  • Queued (chatStatus='queued') — the dispatcher hasn't claimed the row yet. Flip the session back to idle and return; no executor cancel event needed.
  • Running (chatStatus='running') — publish a cancel event to the executor via RabbitMQ FANOUT, then poll Redis until the task status flips out of running or a 5 s timeout is hit.
post/api/chat/sessions/{session_id}/cancel

Request

Path parameters

session_idstring required

Response

Successful Response

cancelledboolean required
reasonstring nullable

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status