{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "AbsolutePathBuf": {
      "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.",
      "type": "string"
    },
    "ApprovalsReviewer": {
      "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.",
      "enum": [
        "user",
        "auto_review",
        "guardian_subagent"
      ],
      "type": "string"
    },
    "AskForApproval": {
      "oneOf": [
        {
          "enum": [
            "untrusted",
            "on-request",
            "never"
          ],
          "type": "string"
        },
        {
          "additionalProperties": false,
          "properties": {
            "granular": {
              "properties": {
                "mcp_elicitations": {
                  "type": "boolean"
                },
                "request_permissions": {
                  "default": false,
                  "type": "boolean"
                },
                "rules": {
                  "type": "boolean"
                },
                "sandbox_approval": {
                  "type": "boolean"
                },
                "skill_approval": {
                  "default": false,
                  "type": "boolean"
                }
              },
              "required": [
                "mcp_elicitations",
                "rules",
                "sandbox_approval"
              ],
              "type": "object"
            }
          },
          "required": [
            "granular"
          ],
          "title": "GranularAskForApproval",
          "type": "object"
        }
      ]
    },
    "SandboxMode": {
      "enum": [
        "read-only",
        "workspace-write",
        "danger-full-access"
      ],
      "type": "string"
    },
    "ThreadSource": {
      "type": "string"
    }
  },
  "description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using a non-empty path, the thread_id param will be ignored. Empty string path values are treated as absent.\n\nPrefer using thread_id whenever possible.",
  "properties": {
    "approvalPolicy": {
      "anyOf": [
        {
          "$ref": "#/definitions/AskForApproval"
        },
        {
          "type": "null"
        }
      ]
    },
    "approvalsReviewer": {
      "anyOf": [
        {
          "$ref": "#/definitions/ApprovalsReviewer"
        },
        {
          "type": "null"
        }
      ],
      "description": "Override where approval requests are routed for review on this thread and subsequent turns."
    },
    "baseInstructions": {
      "type": [
        "string",
        "null"
      ]
    },
    "beforeTurnId": {
      "description": "Optional turn id to fork before, excluding that turn and all later turns. Cannot be combined with `last_turn_id`.",
      "type": [
        "string",
        "null"
      ]
    },
    "config": {
      "additionalProperties": true,
      "type": [
        "object",
        "null"
      ]
    },
    "cwd": {
      "type": [
        "string",
        "null"
      ]
    },
    "deferGoalContinuation": {
      "description": "When true, carry the source thread's current goal into the fork without starting its initial automatic continuation. The next explicit turn owns the goal lifecycle, and normal automatic continuation resumes after it.",
      "type": "boolean"
    },
    "developerInstructions": {
      "type": [
        "string",
        "null"
      ]
    },
    "ephemeral": {
      "type": "boolean"
    },
    "excludeTurns": {
      "description": "When true, return only thread metadata and live fork state without populating `thread.turns`. This is useful when the client plans to call `thread/turns/list` immediately after forking.",
      "type": "boolean"
    },
    "lastTurnId": {
      "description": "Optional last turn id to fork through, inclusive.\n\nWhen specified, turns after `last_turn_id` are omitted from the fork. The referenced turn cannot be in progress.",
      "type": [
        "string",
        "null"
      ]
    },
    "model": {
      "description": "Configuration overrides for the forked thread, if any.",
      "type": [
        "string",
        "null"
      ]
    },
    "modelProvider": {
      "type": [
        "string",
        "null"
      ]
    },
    "path": {
      "default": null,
      "description": "[UNSTABLE] Specify the rollout path to fork from. If specified, the thread_id param will be ignored.",
      "type": [
        "string",
        "null"
      ]
    },
    "permissions": {
      "description": "Named profile id for the forked thread. Cannot be combined with `sandbox`.",
      "type": [
        "string",
        "null"
      ]
    },
    "runtimeWorkspaceRoots": {
      "description": "Replace the thread's runtime workspace roots. Paths must be absolute.",
      "items": {
        "$ref": "#/definitions/AbsolutePathBuf"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "sandbox": {
      "anyOf": [
        {
          "$ref": "#/definitions/SandboxMode"
        },
        {
          "type": "null"
        }
      ]
    },
    "serviceTier": {
      "type": [
        "string",
        "null"
      ]
    },
    "threadId": {
      "type": "string"
    },
    "threadSource": {
      "anyOf": [
        {
          "$ref": "#/definitions/ThreadSource"
        },
        {
          "type": "null"
        }
      ],
      "description": "Optional client-supplied analytics source classification for this forked thread."
    }
  },
  "required": [
    "threadId"
  ],
  "title": "ThreadForkParams",
  "type": "object"
}