v51

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01302395850.8 KB
v2
chat
chat

Cancel Session Task

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

Path parameters

session_idstring required

Response

Successful Response

cancelledboolean required
reasonstring nullable