Skip to main content

Module task_lifecycle

Module task_lifecycle 

Source
Expand description

A2A GetTask and CancelTask typed envelopes.

§What these are

GetTaskRequest and GetTaskResponse are the typed shapes for the GetTask JSON-RPC method. The method fetches a task’s current state by id; a client polls it to advance a Submitted / Working task to a terminal state.

CancelTaskRequest and CancelTaskResponse are the typed shapes for the CancelTask JSON-RPC method. The method requests that a task be cancelled; the response is the task as it was observed at the moment of cancellation.

Both methods return a Task on success — CancelTask returns the task in Cancelled state (or the state it was in, if the task had already completed), and GetTask returns the task in whatever state it is currently in.

§Why one file for two methods

GetTask and CancelTask are paired: a client uses GetTask to poll a task to completion, and CancelTask to abort a long-running task. Their request shapes overlap (both take an id), and the file-split the project uses for the rest of the A2A IR is “one method per file”, but pairing them keeps the relationship visible at a glance.

Structs§

CancelTaskRequest
A typed CancelTask request. Wire form:
CancelTaskResponse
A typed CancelTask response. The wire form is the Task object directly.
GetTaskRequest
A typed GetTask request. Wire form:
GetTaskResponse
A typed GetTask response. The wire form is the Task object directly.