Cancel a running background task
background-tasks
Cancel a running background task
Cancel a running background task by task_id.
The underlying asyncio task is cancelled immediately. The
on_complete callback will not be invoked, so no result
notification is injected into the agent context.
Args:
session_id (str):
The owning session (used to scope the lookup).
task_id (str):
The task to cancel.
_ (str):
The authenticated user ID (unused, required for auth check).
bg_manager (BackgroundTaskManager):
The application-wide background task manager.
Raises:
HTTPException:
404 if task_id is not found or does not belong to
session_id.
DELETE
Cancel a running background task
Documentation Index
Fetch the complete documentation index at: https://docs.agentscope.io/llms.txt
Use this file to discover all available pages before exploring further.