MCPcopy Index your code
hub / github.com/github/copilot-sdk / cancel

Method cancel

python/copilot/generated/rpc.py:25919–25923  ·  view source on GitHub ↗

Cancels a background task.\n\nArgs:\n params: Identifier of the background task to cancel.\n\nReturns:\n Indicates whether the background task was successfully cancelled.

(self, params: TasksCancelRequest, *, timeout: float | None = None)

Source from the content-addressed store, hash-verified

25917 return TasksPromoteCurrentToBackgroundResult.from_dict(await self._client.request("session.tasks.promoteCurrentToBackground", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)))
25918
25919 async def cancel(self, params: TasksCancelRequest, *, timeout: float | None = None) -> TasksCancelResult:
25920 "Cancels a background task.\n\nArgs:\n params: Identifier of the background task to cancel.\n\nReturns:\n Indicates whether the background task was successfully cancelled."
25921 params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None}
25922 params_dict["sessionId"] = self._session_id
25923 return TasksCancelResult.from_dict(await self._client.request("session.tasks.cancel", params_dict, **_timeout_kwargs(timeout)))
25924
25925 async def remove(self, params: TasksRemoveRequest, *, timeout: float | None = None) -> TasksRemoveResult:
25926 "Removes a completed or cancelled background task from tracking.\n\nArgs:\n params: Identifier of the completed or cancelled task to remove from tracking.\n\nReturns:\n Indicates whether the task was removed. False when the task does not exist or is still running/idle."

Calls 4

_timeout_kwargsFunction · 0.85
to_dictMethod · 0.45
from_dictMethod · 0.45
requestMethod · 0.45