Skip to main content

ThreadForkParams

Struct ThreadForkParams 

Source
pub struct ThreadForkParams {
Show 18 fields pub approval_policy: Option<AskForApproval>, pub approvals_reviewer: Option<ApprovalsReviewer>, pub base_instructions: Option<String>, pub config: Option<Map<String, Value>>, pub cwd: Option<String>, pub developer_instructions: Option<String>, pub ephemeral: Option<bool>, pub exclude_turns: Option<bool>, pub last_turn_id: Option<String>, pub model: Option<String>, pub model_provider: Option<String>, pub path: Option<String>, pub permissions: Option<String>, pub runtime_workspace_roots: Option<Vec<AbsolutePathBuf>>, pub sandbox: Option<SandboxMode>, pub service_tier: Option<String>, pub thread_id: String, pub thread_source: Option<ThreadSource>,
}
Expand 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.

If using a non-empty path, the thread_id param will be ignored. Empty string path values are treated as absent.

Prefer using thread_id whenever possible.

JSON schema
{
 "title": "ThreadForkParams",
 "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.",
 "type": "object",
 "required": [
   "threadId"
 ],
 "properties": {
   "approvalPolicy": {
     "anyOf": [
       {
         "$ref": "#/definitions/AskForApproval"
       },
       {
         "type": "null"
       }
     ]
   },
   "approvalsReviewer": {
     "description": "Override where approval requests are routed for review on this thread and subsequent turns.",
     "anyOf": [
       {
         "$ref": "#/definitions/ApprovalsReviewer"
       },
       {
         "type": "null"
       }
     ]
   },
   "baseInstructions": {
     "type": [
       "string",
       "null"
     ]
   },
   "config": {
     "type": [
       "object",
       "null"
     ],
     "additionalProperties": true
   },
   "cwd": {
     "type": [
       "string",
       "null"
     ]
   },
   "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": {
     "description": "[UNSTABLE] Specify the rollout path to fork from. If specified, the thread_id param will be ignored.",
     "default": null,
     "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.",
     "type": [
       "array",
       "null"
     ],
     "items": {
       "$ref": "#/definitions/AbsolutePathBuf"
     }
   },
   "sandbox": {
     "anyOf": [
       {
         "$ref": "#/definitions/SandboxMode"
       },
       {
         "type": "null"
       }
     ]
   },
   "serviceTier": {
     "type": [
       "string",
       "null"
     ]
   },
   "threadId": {
     "type": "string"
   },
   "threadSource": {
     "description": "Optional client-supplied analytics source classification for this forked thread.",
     "anyOf": [
       {
         "$ref": "#/definitions/ThreadSource"
       },
       {
         "type": "null"
       }
     ]
   }
 },
 "$schema": "http://json-schema.org/draft-07/schema#"
}

Fields§

§approval_policy: Option<AskForApproval>§approvals_reviewer: Option<ApprovalsReviewer>

Override where approval requests are routed for review on this thread and subsequent turns.

§base_instructions: Option<String>§config: Option<Map<String, Value>>§cwd: Option<String>§developer_instructions: Option<String>§ephemeral: Option<bool>§exclude_turns: Option<bool>

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.

§last_turn_id: Option<String>

Optional last turn id to fork through, inclusive.

When specified, turns after last_turn_id are omitted from the fork. The referenced turn cannot be in progress.

§model: Option<String>

Configuration overrides for the forked thread, if any.

§model_provider: Option<String>§path: Option<String>

[UNSTABLE] Specify the rollout path to fork from. If specified, the thread_id param will be ignored.

§permissions: Option<String>

Named profile id for the forked thread. Cannot be combined with sandbox.

§runtime_workspace_roots: Option<Vec<AbsolutePathBuf>>

Replace the thread’s runtime workspace roots. Paths must be absolute.

§sandbox: Option<SandboxMode>§service_tier: Option<String>§thread_id: String§thread_source: Option<ThreadSource>

Optional client-supplied analytics source classification for this forked thread.

Trait Implementations§

Source§

impl Clone for ThreadForkParams

Source§

fn clone(&self) -> ThreadForkParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ThreadForkParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ThreadForkParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ThreadForkParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,