pub struct TaskNotificationMessage {Show 15 fields
pub session_id: String,
pub task_id: String,
pub run_id: Option<String>,
pub status: TaskStatus,
pub reason: Option<TaskEndReason>,
pub summary: String,
pub output_file: Option<String>,
pub tool_use_id: Option<String>,
pub usage: Option<TaskUsage>,
pub resource_links: Vec<ResourceLink>,
pub handback: Option<TaskHandback>,
pub handback_report: Option<HandbackReport>,
pub skip_transcript: Option<bool>,
pub ambient: Option<bool>,
pub uuid: Option<String>,
}Expand description
task_notification system message — emitted once when a background
task completes or fails.
Fields§
§session_id: String§task_id: String§run_id: Option<String>Id of the task run this notification closes; see
TaskStartedMessage::run_id (CLI 2.1.292+).
status: TaskStatus§reason: Option<TaskEndReason>Machine-readable cause, set only when the task did not end through an ordinary completion, failure, or stop (CLI 2.1.273+).
summary: String§output_file: Option<String>§tool_use_id: Option<String>§usage: Option<TaskUsage>§resource_links: Vec<ResourceLink>For a backgrounded MCP task that completed, the resource_link
content blocks of its final result — the files it returned by
reference — collected from the raw result before the CLI renders it
as text. Join to the originating call via tool_use_id. Absent when
the result had none or the task is any other type (CLI 2.1.259+).
handback: Option<TaskHandback>On a completed notification of a subagent that reports through the
SubagentHandback tool: how its report reached its caller. Left out
when the subagent failed, was stopped, or is still waiting on work;
summary is then not a report. When present, summary holds harness
notes written for the model. A later notification for the same
task_id replaces what an earlier one showed (CLI 2.1.292+).
handback_report: Option<HandbackReport>The report a send or flagged hand-back delivered: when present,
render it instead of summary, with its warning, if any, above its
text. Absent for withheld (CLI 2.1.292+).
skip_transcript: Option<bool>§ambient: Option<bool>True for housekeeping tasks the CLI does not surface as user work; hosts should exclude them from activity indicators (CLI 2.1.259+).
uuid: Option<String>