Skip to content
Skip to main content
Event streaming

Task Agent

Event streaming

Read SSE frames, resume after disconnection, and interpret Event v2.

Task Agent sends session progress through Server-Sent Events (SSE). Persisted events use the HAST Event v2 envelope, matching GET /sessions/{id}/events.

Connect to the stream

Set HAST_API_BASE, HAST_API_KEY, and SESSION_ID as in the quickstart:

curl -N --fail-with-body \
  "$HAST_API_BASE/sessions/$SESSION_ID/events/stream?after=0" \
  -H "Authorization: Bearer $HAST_API_KEY" \
  -H 'Accept: text/event-stream'

Reading requires sessions:read. The response is text/event-stream and also sends : keep-alive comments between events.

SSE frame format

id: 42
event: message.completed
data: {"schema_version":2,"event_id":"evt_123",...}

The abbreviated data illustrates framing; actual data is a complete JSON event. Blank lines separate frames.

FieldMeaning
idPersisted sequence for resuming
eventEvent type, matching envelope type
dataHAST Event v2 JSON envelope

Resume and replay

Save the processed persisted sequence. Reconnect with after or the Last-Event-ID header. Do not use event_id as the sequence.

curl -N --fail-with-body \
  "$HAST_API_BASE/sessions/$SESSION_ID/events/stream" \
  -H "Authorization: Bearer $HAST_API_KEY" \
  -H 'Accept: text/event-stream' \
  -H 'Last-Event-ID: 42'

Read events as JSON

For polling, use GET /sessions/{id}/events with after and limit. See session and event endpoints.

Event v2 and event types

The envelope contains version, event ID, source, engine, task identity, type, and data. sequence is a positive integer for persisted events and null for ephemeral ones; replayable indicates replay support.

type determines the structure of data. Messages, tools, plans, and runs carry different fields. A completed message does not complete a run; use run.completed, run.failed, or run.interrupted to determine the outcome.

The schemas below come directly from the same OpenAPI JSON. Expand them for fields, required constraints, and examples. References to api.TaskAgentEventDoc point to the shared envelope; the other fields describe type-specific data.

Complete Event v2 envelope
JSON
{
  "discriminator": "type",
  "properties": {
    "created_at": {
      "example": "2026-08-16T12:00:00Z",
      "format": "date-time",
      "type": "string"
    },
    "data": {
      "allOf": [
        {
          "properties": {
            "attempt": {
              "minimum": 1,
              "type": "integer"
            },
            "attempts": {
              "minimum": 1,
              "type": "integer"
            },
            "channel": {
              "enum": [
                "stdout",
                "stderr",
                "progress"
              ],
              "type": "string"
            },
            "code": {
              "type": "string"
            },
            "context_window": {
              "minimum": 0,
              "type": "integer"
            },
            "cost": {},
            "delta": {
              "type": "string"
            },
            "duration_ms": {
              "minimum": 0,
              "type": "integer"
            },
            "error": {
              "type": "string"
            },
            "exit_code": {
              "type": "integer"
            },
            "files": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "final_message_id": {
              "type": "string"
            },
            "finish_reason": {
              "type": "string"
            },
            "input": {},
            "is_error": {
              "type": "boolean"
            },
            "kind": {
              "type": "string"
            },
            "last": {
              "properties": {
                "cache_read_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cache_write_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "input_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "output_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "reasoning_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "total_tokens": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "cache_read_tokens",
                "cache_write_tokens",
                "input_tokens",
                "output_tokens",
                "reasoning_tokens",
                "total_tokens"
              ],
              "type": "object"
            },
            "message": {
              "type": "string"
            },
            "message_id": {
              "type": "string"
            },
            "model": {
              "type": "string"
            },
            "model_source": {
              "type": "string"
            },
            "modified_at": {
              "format": "date-time",
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "operation": {
              "enum": [
                "update",
                "delete"
              ],
              "type": "string"
            },
            "options": {
              "items": {},
              "type": "array"
            },
            "output": {},
            "parent_tool_call_id": {
              "type": "string"
            },
            "path": {
              "type": "string"
            },
            "plan_id": {
              "type": "string"
            },
            "prompt": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "reasoning_id": {
              "type": "string"
            },
            "request_id": {
              "type": "string"
            },
            "retryable": {
              "type": "boolean"
            },
            "role": {
              "enum": [
                "user",
                "assistant",
                "system"
              ],
              "type": "string"
            },
            "scope": {
              "type": "string"
            },
            "size_bytes": {
              "minimum": 0,
              "type": "integer"
            },
            "status": {
              "enum": [
                "starting",
                "ready",
                "failed",
                "released",
                "succeeded",
                "interrupted"
              ],
              "type": "string"
            },
            "steps": {
              "items": {
                "properties": {
                  "status": {
                    "enum": [
                      "pending",
                      "in_progress",
                      "completed"
                    ],
                    "example": "in_progress",
                    "type": "string"
                  },
                  "step": {
                    "type": "string"
                  }
                },
                "required": [
                  "status",
                  "step"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "text": {
              "type": "string"
            },
            "tokens_after": {
              "minimum": 0,
              "type": "integer"
            },
            "tokens_before": {
              "minimum": 0,
              "type": "integer"
            },
            "tool_call_id": {
              "type": "string"
            },
            "total": {
              "properties": {
                "cache_read_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cache_write_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "input_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "output_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "reasoning_tokens": {
                  "minimum": 0,
                  "type": "integer"
                },
                "total_tokens": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "cache_read_tokens",
                "cache_write_tokens",
                "input_tokens",
                "output_tokens",
                "reasoning_tokens",
                "total_tokens"
              ],
              "type": "object"
            },
            "turn_type": {
              "type": "string"
            }
          },
          "type": "object"
        }
      ],
      "description": "Data is the HAST-owned payload union; Type selects its required shape as\ndefined in docs/reference/task-agent-event-v2.md."
    },
    "engine": {
      "enum": [
        "codex_cli",
        "pi_agent_cli"
      ],
      "example": "codex_cli",
      "type": "string"
    },
    "event_id": {
      "example": "evt_123",
      "type": "string"
    },
    "replayable": {
      "example": true,
      "type": "boolean"
    },
    "run_id": {
      "example": "run_123",
      "type": "string"
    },
    "schema_version": {
      "enum": [
        2
      ],
      "example": 2,
      "type": "integer"
    },
    "sequence": {
      "description": "Sequence is a positive durable order, or null for volatile events.",
      "example": 42,
      "minimum": 1,
      "type": "integer",
      "x-nullable": true
    },
    "session_id": {
      "example": "session_123",
      "type": "string"
    },
    "source": {
      "enum": [
        "runtime",
        "backplane",
        "workspace"
      ],
      "example": "runtime",
      "type": "string"
    },
    "task_id": {
      "example": "task_123",
      "type": "string"
    },
    "type": {
      "enum": [
        "runtime.status",
        "run.queued",
        "run.started",
        "run.retrying",
        "run.completed",
        "run.failed",
        "run.interrupted",
        "message.started",
        "message.delta",
        "message.completed",
        "reasoning.started",
        "reasoning.delta",
        "reasoning.completed",
        "tool.started",
        "tool.updated",
        "tool.completed",
        "plan.updated",
        "plan.completed",
        "usage.updated",
        "file.changed",
        "input.requested",
        "context.compacted",
        "warning",
        "error"
      ],
      "example": "message.completed",
      "type": "string"
    }
  },
  "required": [
    "created_at",
    "data",
    "engine",
    "event_id",
    "replayable",
    "schema_version",
    "sequence",
    "source",
    "task_id",
    "type"
  ],
  "type": "object"
}
context.compacted
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reason"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "context.compacted"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
error
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "scope",
                "code",
                "message",
                "retryable"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "error"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
file.changed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "path",
                "operation"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "file.changed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
input.requested
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "request_id",
                "kind",
                "prompt"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "input.requested"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
message.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "message_id",
                "role",
                "text"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "message.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
message.delta
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "message_id",
                "role",
                "delta"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "message.delta"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
message.started
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "message_id",
                "role"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "message.started"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
plan.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "plan_id"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "plan.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
plan.updated
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "plan_id"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "plan.updated"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
reasoning.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reasoning_id",
                "text"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "reasoning.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
reasoning.delta
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reasoning_id",
                "delta"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "reasoning.delta"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
reasoning.started
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reasoning_id"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "reasoning.started"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "final_message_id",
                "finish_reason",
                "attempts"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.failed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "code",
                "message",
                "retryable",
                "attempts"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.failed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.interrupted
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "reason"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.interrupted"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.queued
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "request_id",
                "turn_type"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.queued"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.retrying
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "attempt",
                "code",
                "message"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.retrying"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
run.started
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "request_id",
                "turn_type"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "run.started"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
runtime.status
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "properties": {
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "status"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "runtime.status"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
tool.completed
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "properties": {
                "status": {
                  "enum": [
                    "succeeded",
                    "failed",
                    "interrupted"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "tool_call_id",
                "kind",
                "name",
                "status",
                "is_error"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "tool.completed"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
tool.started
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "tool_call_id",
                "kind",
                "name"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "tool.started"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
tool.updated
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "tool_call_id",
                "channel",
                "delta"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "tool.updated"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
usage.updated
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "model",
                "context_window",
                "total"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "usage.updated"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
warning
JSON
{
  "allOf": [
    {
      "$ref": "#/definitions/api.TaskAgentEventDoc"
    },
    {
      "properties": {
        "data": {
          "allOf": [
            {
              "properties": {
                "attempt": {
                  "minimum": 1,
                  "type": "integer"
                },
                "attempts": {
                  "minimum": 1,
                  "type": "integer"
                },
                "channel": {
                  "enum": [
                    "stdout",
                    "stderr",
                    "progress"
                  ],
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "context_window": {
                  "minimum": 0,
                  "type": "integer"
                },
                "cost": {},
                "delta": {
                  "type": "string"
                },
                "duration_ms": {
                  "minimum": 0,
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "exit_code": {
                  "type": "integer"
                },
                "files": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "final_message_id": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": "string"
                },
                "input": {},
                "is_error": {
                  "type": "boolean"
                },
                "kind": {
                  "type": "string"
                },
                "last": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "message": {
                  "type": "string"
                },
                "message_id": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "model_source": {
                  "type": "string"
                },
                "modified_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "operation": {
                  "enum": [
                    "update",
                    "delete"
                  ],
                  "type": "string"
                },
                "options": {
                  "items": {},
                  "type": "array"
                },
                "output": {},
                "parent_tool_call_id": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "plan_id": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "reasoning_id": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "retryable": {
                  "type": "boolean"
                },
                "role": {
                  "enum": [
                    "user",
                    "assistant",
                    "system"
                  ],
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "size_bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "starting",
                    "ready",
                    "failed",
                    "released",
                    "succeeded",
                    "interrupted"
                  ],
                  "type": "string"
                },
                "steps": {
                  "items": {
                    "properties": {
                      "status": {
                        "enum": [
                          "pending",
                          "in_progress",
                          "completed"
                        ],
                        "example": "in_progress",
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "status",
                      "step"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "text": {
                  "type": "string"
                },
                "tokens_after": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tokens_before": {
                  "minimum": 0,
                  "type": "integer"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "total": {
                  "properties": {
                    "cache_read_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "input_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "output_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "reasoning_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "total_tokens": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "cache_read_tokens",
                    "cache_write_tokens",
                    "input_tokens",
                    "output_tokens",
                    "reasoning_tokens",
                    "total_tokens"
                  ],
                  "type": "object"
                },
                "turn_type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            {
              "required": [
                "scope",
                "code",
                "message",
                "retryable"
              ],
              "type": "object"
            }
          ]
        },
        "type": {
          "enum": [
            "warning"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "data"
      ],
      "type": "object"
    }
  ]
}
Meet HastLearn about Hast AIP, Hast Agent, Hast GTM, and delivery with the FDE team.About AIPConfigure Agents and connect business systems using the FDE delivery workbench.Create your first AgentConfigure, save, and debug an Agent without external services.Configure and manage AgentsSet responsibilities, models, and capabilities, and maintain the active configuration.Manage SkillsWrite, import, and select the skill files used by Agents.Add a knowledge baseIndex URLs or files so an Agent can retrieve information from them.Manage business secretsStore credentials and bind them to Agents without exposing real values in examples.Connect business toolsLet Agents call HTTP services with explicit inputs and authentication.Configure long-term memoryChoose what memory an Agent can read and where new memory is written.Debug an AgentTest saved configurations, conversation continuity, and tool results.Import, export, and copyReuse configurations and recheck resources and credentials after migration.HTTP integrationInvoke an Agent from your server, continue conversations, read replies, and stop execution.MCP integrationConnect external Agent clients to AIP tools with a Public API Key.About Task AgentPlan, execute, and deliver complete tasks with tools, files, and lasting context.Complete your first taskSubmit a request, review the plan, and inspect the final output.Plan, execute, and manage conversationsRefine plans, stop execution, and manage conversation history.Upload, view, and download filesProvide inputs and keep the files created by your tasks.Connect apps and configure capabilitiesAuthorize external apps and maintain context across tasks.Create scheduled tasksSet recurrence and timezone, then inspect each run's result.Task Agent troubleshootingCheck access, connections, task state, and files.API quickstartCreate a key, submit a task, and read execution results.Event streamingRead SSE frames, resume after disconnection, and interpret Event v2.API referenceExplore public endpoint parameters, authentication, and response schemas.About GTMUse a shared website project for research, visibility analysis, and marketing drafts.Create your first GTM projectEnter a website, wait for initialization, and inspect the first results.Manage projects and website contextSwitch projects, refresh site information, and manage project settings.Company analysis and project documentsReview product, competitor, and marketing context before content tasks.SEO and website performanceRead PageSpeed reports for mobile and desktop.AI brand mentionsInspect buyer questions and whether model answers mention your brand.Connect Google AnalyticsAuthorize an account, choose a GA property, and inspect traffic reports.Generate and publish X draftsCreate posts, review previews, and finish publishing on X.Generate article draftsSet style, language, and audience, then review and copy Markdown.Use Growth AgentRead project context or start supported background operations in conversation.Run status and troubleshootingCheck queueing, dependencies, and results without treating unfinished work as missing data.Plans and usageCheck access, consumption, and billing for the current Profile.