This commit is contained in:
Xoconoch
2025-08-09 13:37:56 -06:00
parent 6c18f09bad
commit 84cf57e451
3 changed files with 489 additions and 35 deletions

View File

@@ -873,6 +873,12 @@ async def cancel_task_endpoint(task_id: str, current_user: User = Depends(requir
if task_info:
# This is a task ID in the new system
result = cancel_task(task_id)
try:
# Push an immediate SSE update so clients reflect cancellation and partial summary
await trigger_sse_update(task_id, "cancelled")
result["sse_notified"] = True
except Exception as e:
logger.error(f"SSE notify after cancel failed for {task_id}: {e}")
return result
# If not found in new system, we need to handle the old system cancellation