Class SessionTasksApi
tasks namespace.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncancel(SessionTasksCancelParams params) Cancels a background task.Returns the first sync-waiting task that can currently be promoted to background mode.Returns progress information for a background task by ID.list()Lists background tasks tracked by the session.Atomically promotes the first promotable sync-waiting task to background mode and returns it.Promotes an eligible synchronously-waited task so it continues running in the background.refresh()Refreshes metadata for any detached background shells the runtime knows about.register(SessionTasksRegisterParams params) Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal.remove(SessionTasksRemoveParams params) Removes a completed or cancelled background task from tracking.Sends a message to a background agent task.Starts a background agent task in the session.update(SessionTasksUpdateParams params) Publishes generic progress or a terminal outcome for a client-owned task.Waits for all in-flight background tasks and any follow-up turns to settle.
-
Method Details
-
startAgent
@CopilotExperimental public CompletableFuture<SessionTasksStartAgentResult> startAgent(SessionTasksStartAgentParams params) Starts a background agent task in the session.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
list
Lists background tasks tracked by the session.- Since:
- 1.0.0
-
register
@CopilotExperimental public CompletableFuture<SessionTasksRegisterResult> register(SessionTasksRegisterParams params) Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
update
@CopilotExperimental public CompletableFuture<SessionTasksUpdateResult> update(SessionTasksUpdateParams params) Publishes generic progress or a terminal outcome for a client-owned task.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
refresh
Refreshes metadata for any detached background shells the runtime knows about.- Since:
- 1.0.0
-
waitForPending
Waits for all in-flight background tasks and any follow-up turns to settle.- Since:
- 1.0.0
-
getProgress
@CopilotExperimental public CompletableFuture<SessionTasksGetProgressResult> getProgress(SessionTasksGetProgressParams params) Returns progress information for a background task by ID.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
getCurrentPromotable
@CopilotExperimental public CompletableFuture<SessionTasksGetCurrentPromotableResult> getCurrentPromotable()Returns the first sync-waiting task that can currently be promoted to background mode.- Since:
- 1.0.0
-
promoteToBackground
@CopilotExperimental public CompletableFuture<SessionTasksPromoteToBackgroundResult> promoteToBackground(SessionTasksPromoteToBackgroundParams params) Promotes an eligible synchronously-waited task so it continues running in the background.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
promoteCurrentToBackground
@CopilotExperimental public CompletableFuture<SessionTasksPromoteCurrentToBackgroundResult> promoteCurrentToBackground()Atomically promotes the first promotable sync-waiting task to background mode and returns it.- Since:
- 1.0.0
-
cancel
@CopilotExperimental public CompletableFuture<SessionTasksCancelResult> cancel(SessionTasksCancelParams params) Cancels a background task.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
remove
@CopilotExperimental public CompletableFuture<SessionTasksRemoveResult> remove(SessionTasksRemoveParams params) Removes a completed or cancelled background task from tracking.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
sendMessage
@CopilotExperimental public CompletableFuture<SessionTasksSendMessageResult> sendMessage(SessionTasksSendMessageParams params) Sends a message to a background agent task.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-