{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-agent-run-step-schema.json",
  "title": "Agent run step",
  "description": "One persisted step, as stored (camelCase keys).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-agents-api-openapi.yml#/components/schemas/AgentRunStep",
  "type": "object",
  "required": [
    "id",
    "runId",
    "seq",
    "kind",
    "summary",
    "detail",
    "latencyMs",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "runId": {
      "type": "string",
      "format": "uuid"
    },
    "seq": {
      "type": "integer",
      "minimum": 0,
      "description": "Monotonic step index within the run."
    },
    "kind": {
      "type": "string",
      "enum": [
        "plan",
        "tool_call",
        "observation",
        "answer"
      ]
    },
    "summary": {
      "type": [
        "string",
        "null"
      ],
      "description": "Assistant content, tool name or observation summary (redacted, ≤ 2000 chars)."
    },
    "detail": {
      "description": "Structured detail (tool args/result, redacted). Always `null` for steps written by the current executor.",
      "nullable": true
    },
    "latencyMs": {
      "type": [
        "integer",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}