mirror of
https://github.com/openai/codex.git
synced 2026-11-16 22:00:36 +00:00
simplification
This commit is contained in:
+10
-3
@@ -3193,6 +3193,10 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disableMultiAgentTools": {
|
||||
"description": "When true, disable multi-agent collaboration tools for the forked thread.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -3237,7 +3241,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional client-supplied source classification for this forked thread. Threads marked as `side` do not receive multi-agent collaboration tools."
|
||||
"description": "Optional client-supplied analytics source classification for this forked thread."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -3797,7 +3801,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
@@ -3866,6 +3869,10 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disableMultiAgentTools": {
|
||||
"description": "When true, disable multi-agent collaboration tools for this thread.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": [
|
||||
"boolean",
|
||||
@@ -3935,7 +3942,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional client-supplied source classification for this thread. Threads marked as `side` do not receive multi-agent collaboration tools."
|
||||
"description": "Optional client-supplied analytics source classification for this thread."
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
|
||||
@@ -3463,7 +3463,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -4617,7 +4617,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
+11
-4
@@ -15879,7 +15879,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -16051,6 +16051,10 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disableMultiAgentTools": {
|
||||
"description": "When true, disable multi-agent collaboration tools for the forked thread.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -16095,7 +16099,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional client-supplied source classification for this forked thread. Threads marked as `side` do not receive multi-agent collaboration tools."
|
||||
"description": "Optional client-supplied analytics source classification for this forked thread."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -18059,7 +18063,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
@@ -18129,6 +18132,10 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disableMultiAgentTools": {
|
||||
"description": "When true, disable multi-agent collaboration tools for this thread.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": [
|
||||
"boolean",
|
||||
@@ -18198,7 +18205,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional client-supplied source classification for this thread. Threads marked as `side` do not receive multi-agent collaboration tools."
|
||||
"description": "Optional client-supplied analytics source classification for this thread."
|
||||
}
|
||||
},
|
||||
"title": "ThreadStartParams",
|
||||
|
||||
+11
-4
@@ -13696,7 +13696,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -13868,6 +13868,10 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disableMultiAgentTools": {
|
||||
"description": "When true, disable multi-agent collaboration tools for the forked thread.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -13912,7 +13916,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional client-supplied source classification for this forked thread. Threads marked as `side` do not receive multi-agent collaboration tools."
|
||||
"description": "Optional client-supplied analytics source classification for this forked thread."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -15876,7 +15880,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
@@ -15946,6 +15949,10 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disableMultiAgentTools": {
|
||||
"description": "When true, disable multi-agent collaboration tools for this thread.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": [
|
||||
"boolean",
|
||||
@@ -16015,7 +16022,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional client-supplied source classification for this thread. Threads marked as `side` do not receive multi-agent collaboration tools."
|
||||
"description": "Optional client-supplied analytics source classification for this thread."
|
||||
}
|
||||
},
|
||||
"title": "ThreadStartParams",
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
@@ -130,6 +129,10 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disableMultiAgentTools": {
|
||||
"description": "When true, disable multi-agent collaboration tools for the forked thread.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -174,7 +177,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional client-supplied source classification for this forked thread. Threads marked as `side` do not receive multi-agent collaboration tools."
|
||||
"description": "Optional client-supplied analytics source classification for this forked thread."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
@@ -1084,7 +1084,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1832,7 +1832,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
@@ -899,7 +899,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1647,7 +1647,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
+1
-2
@@ -899,7 +899,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1647,7 +1647,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
@@ -899,7 +899,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1647,7 +1647,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
@@ -1084,7 +1084,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1832,7 +1832,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
@@ -899,7 +899,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1647,7 +1647,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
@@ -109,7 +109,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
@@ -185,6 +184,10 @@
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disableMultiAgentTools": {
|
||||
"description": "When true, disable multi-agent collaboration tools for this thread.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": [
|
||||
"boolean",
|
||||
@@ -254,7 +257,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional client-supplied source classification for this thread. Threads marked as `side` do not receive multi-agent collaboration tools."
|
||||
"description": "Optional client-supplied analytics source classification for this thread."
|
||||
}
|
||||
},
|
||||
"title": "ThreadStartParams",
|
||||
|
||||
@@ -1084,7 +1084,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1832,7 +1832,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
+1
-2
@@ -899,7 +899,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1647,7 +1647,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
@@ -899,7 +899,7 @@
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "Optional source classification for this thread. `side` threads do not receive multi-agent collaboration tools."
|
||||
"description": "Optional analytics source classification for this thread."
|
||||
},
|
||||
"turns": {
|
||||
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
|
||||
@@ -1647,7 +1647,6 @@
|
||||
"ThreadSource": {
|
||||
"enum": [
|
||||
"user",
|
||||
"side",
|
||||
"subagent",
|
||||
"memory_consolidation"
|
||||
],
|
||||
|
||||
+1
-2
@@ -62,8 +62,7 @@ cliVersion: string,
|
||||
*/
|
||||
source: SessionSource,
|
||||
/**
|
||||
* Optional source classification for this thread. `side` threads do not receive multi-agent
|
||||
* collaboration tools.
|
||||
* Optional analytics source classification for this thread.
|
||||
*/
|
||||
threadSource: ThreadSource | null,
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,9 @@ model?: string | null, modelProvider?: string | null, serviceTier?: string | nul
|
||||
* and subsequent turns.
|
||||
*/
|
||||
approvalsReviewer?: ApprovalsReviewer | null, sandbox?: SandboxMode | null, config?: { [key in string]?: JsonValue } | null, baseInstructions?: string | null, developerInstructions?: string | null, ephemeral?: boolean, /**
|
||||
* Optional client-supplied source classification for this forked thread. Threads marked as
|
||||
* `side` do not receive multi-agent collaboration tools.
|
||||
* Optional client-supplied analytics source classification for this forked thread.
|
||||
*/
|
||||
threadSource?: ThreadSource | null};
|
||||
threadSource?: ThreadSource | null, /**
|
||||
* When true, disable multi-agent collaboration tools for the forked thread.
|
||||
*/
|
||||
disableMultiAgentTools?: boolean};
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type ThreadSource = "user" | "side" | "subagent" | "memory_consolidation";
|
||||
export type ThreadSource = "user" | "subagent" | "memory_consolidation";
|
||||
|
||||
@@ -14,7 +14,9 @@ export type ThreadStartParams = {model?: string | null, modelProvider?: string |
|
||||
* and subsequent turns.
|
||||
*/
|
||||
approvalsReviewer?: ApprovalsReviewer | null, sandbox?: SandboxMode | null, config?: { [key in string]?: JsonValue } | null, serviceName?: string | null, baseInstructions?: string | null, developerInstructions?: string | null, personality?: Personality | null, ephemeral?: boolean | null, sessionStartSource?: ThreadStartSource | null, /**
|
||||
* Optional client-supplied source classification for this thread. Threads marked as `side`
|
||||
* do not receive multi-agent collaboration tools.
|
||||
* Optional client-supplied analytics source classification for this thread.
|
||||
*/
|
||||
threadSource?: ThreadSource | null};
|
||||
threadSource?: ThreadSource | null, /**
|
||||
* When true, disable multi-agent collaboration tools for this thread.
|
||||
*/
|
||||
disableMultiAgentTools?: boolean};
|
||||
|
||||
@@ -138,10 +138,12 @@ pub struct ThreadStartParams {
|
||||
pub ephemeral: Option<bool>,
|
||||
#[ts(optional = nullable)]
|
||||
pub session_start_source: Option<ThreadStartSource>,
|
||||
/// Optional client-supplied source classification for this thread. Threads marked as `side`
|
||||
/// do not receive multi-agent collaboration tools.
|
||||
/// Optional client-supplied analytics source classification for this thread.
|
||||
#[ts(optional = nullable)]
|
||||
pub thread_source: Option<ThreadSource>,
|
||||
/// When true, disable multi-agent collaboration tools for this thread.
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
pub disable_multi_agent_tools: bool,
|
||||
/// Optional sticky environments for this thread.
|
||||
///
|
||||
/// Omitted selects the default environment when environment access is
|
||||
@@ -534,10 +536,12 @@ pub struct ThreadForkParams {
|
||||
pub developer_instructions: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
pub ephemeral: bool,
|
||||
/// Optional client-supplied source classification for this forked thread. Threads marked as
|
||||
/// `side` do not receive multi-agent collaboration tools.
|
||||
/// Optional client-supplied analytics source classification for this forked thread.
|
||||
#[ts(optional = nullable)]
|
||||
pub thread_source: Option<ThreadSource>,
|
||||
/// When true, disable multi-agent collaboration tools for the forked thread.
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
pub disable_multi_agent_tools: 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.
|
||||
|
||||
@@ -66,7 +66,6 @@ impl From<SessionSource> for CoreSessionSource {
|
||||
#[ts(rename_all = "snake_case", export_to = "v2/")]
|
||||
pub enum ThreadSource {
|
||||
User,
|
||||
Side,
|
||||
Subagent,
|
||||
MemoryConsolidation,
|
||||
}
|
||||
@@ -75,7 +74,6 @@ impl From<CoreThreadSource> for ThreadSource {
|
||||
fn from(value: CoreThreadSource) -> Self {
|
||||
match value {
|
||||
CoreThreadSource::User => ThreadSource::User,
|
||||
CoreThreadSource::Side => ThreadSource::Side,
|
||||
CoreThreadSource::Subagent => ThreadSource::Subagent,
|
||||
CoreThreadSource::MemoryConsolidation => ThreadSource::MemoryConsolidation,
|
||||
}
|
||||
@@ -86,7 +84,6 @@ impl From<ThreadSource> for CoreThreadSource {
|
||||
fn from(value: ThreadSource) -> Self {
|
||||
match value {
|
||||
ThreadSource::User => CoreThreadSource::User,
|
||||
ThreadSource::Side => CoreThreadSource::Side,
|
||||
ThreadSource::Subagent => CoreThreadSource::Subagent,
|
||||
ThreadSource::MemoryConsolidation => CoreThreadSource::MemoryConsolidation,
|
||||
}
|
||||
@@ -135,8 +132,7 @@ pub struct Thread {
|
||||
pub cli_version: String,
|
||||
/// Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).
|
||||
pub source: SessionSource,
|
||||
/// Optional source classification for this thread. `side` threads do not receive multi-agent
|
||||
/// collaboration tools.
|
||||
/// Optional analytics source classification for this thread.
|
||||
pub thread_source: Option<ThreadSource>,
|
||||
/// Optional random unique nickname assigned to an AgentControl-spawned sub-agent.
|
||||
pub agent_nickname: Option<String>,
|
||||
|
||||
@@ -130,9 +130,9 @@ Example with notification opt-out:
|
||||
|
||||
## API Overview
|
||||
|
||||
- `thread/start` — create a new thread; emits `thread/started` (including the current `thread.status`) and auto-subscribes you to turn/item events for that thread. When the request includes a `cwd` and the resolved sandbox is `workspace-write` or full access, app-server also marks that project as trusted in the user `config.toml`. Pass `sessionStartSource: "clear"` when starting a replacement thread after clearing the current session so `SessionStart` hooks receive `source: "clear"` instead of the default `"startup"`. Experimental `runtimeWorkspaceRoots` replaces the thread-scoped runtime workspace roots used to materialize `:workspace_roots`; paths must be absolute. For permissions, prefer experimental `permissions` profile selection by id; the legacy `sandbox` shorthand is still accepted but cannot be combined with `permissions`. Experimental `environments` selects the sticky execution environments for turns on the thread; omit it to use the server default, pass `[]` to disable environments, or pass explicit environment ids with per-environment `cwd`.
|
||||
- `thread/start` — create a new thread; emits `thread/started` (including the current `thread.status`) and auto-subscribes you to turn/item events for that thread. Set `disableMultiAgentTools: true` to prevent the thread from receiving multi-agent collaboration tools. When the request includes a `cwd` and the resolved sandbox is `workspace-write` or full access, app-server also marks that project as trusted in the user `config.toml`. Pass `sessionStartSource: "clear"` when starting a replacement thread after clearing the current session so `SessionStart` hooks receive `source: "clear"` instead of the default `"startup"`. Experimental `runtimeWorkspaceRoots` replaces the thread-scoped runtime workspace roots used to materialize `:workspace_roots`; paths must be absolute. For permissions, prefer experimental `permissions` profile selection by id; the legacy `sandbox` shorthand is still accepted but cannot be combined with `permissions`. Experimental `environments` selects the sticky execution environments for turns on the thread; omit it to use the server default, pass `[]` to disable environments, or pass explicit environment ids with per-environment `cwd`.
|
||||
- `thread/resume` — reopen an existing thread by id so subsequent `turn/start` calls append to it. Accepts the same permission override rules as `thread/start`.
|
||||
- `thread/fork` — fork an existing thread into a new thread id by copying the stored history; if the source thread is currently mid-turn, the fork records the same interruption marker as `turn/interrupt` instead of inheriting an unmarked partial turn suffix. The returned `thread.forkedFromId` points at the source thread when known. Accepts `ephemeral: true` for an in-memory temporary fork, emits `thread/started` (including the current `thread.status`), and auto-subscribes you to turn/item events for the new thread. Set `threadSource` to `side` for an isolated side conversation; side threads do not receive multi-agent collaboration tools. Experimental clients can pass `excludeTurns: true` when they plan to page fork history via `thread/turns/list` instead of receiving the full turn array immediately. Accepts the same permission override rules as `thread/start`.
|
||||
- `thread/fork` — fork an existing thread into a new thread id by copying the stored history; if the source thread is currently mid-turn, the fork records the same interruption marker as `turn/interrupt` instead of inheriting an unmarked partial turn suffix. The returned `thread.forkedFromId` points at the source thread when known. Accepts `ephemeral: true` for an in-memory temporary fork, emits `thread/started` (including the current `thread.status`), and auto-subscribes you to turn/item events for the new thread. Set `disableMultiAgentTools: true` to prevent the fork from inheriting or enabling multi-agent collaboration tools. Experimental clients can pass `excludeTurns: true` when they plan to page fork history via `thread/turns/list` instead of receiving the full turn array immediately. Accepts the same permission override rules as `thread/start`.
|
||||
- `thread/start`, `thread/resume`, and `thread/fork` responses include the legacy `sandbox` compatibility projection. Experimental clients can read `runtimeWorkspaceRoots` for the thread-scoped runtime roots and `activePermissionProfile` for the named or implicit built-in profile identity/provenance when known.
|
||||
- `thread/list` — page through stored rollouts; supports cursor-based pagination and optional `modelProviders`, `sourceKinds`, `archived`, `cwd`, and `searchTerm` filters. Each returned `thread` includes `status` (`ThreadStatus`), defaulting to `notLoaded` when the thread is not currently loaded. Subagent threads also include `parentThreadId` when the immediate control/spawn parent is known.
|
||||
- `thread/loaded/list` — list the thread ids currently loaded in memory.
|
||||
|
||||
@@ -389,6 +389,7 @@ use codex_protocol::protocol::EventMsg;
|
||||
use codex_protocol::protocol::GitInfo as CoreGitInfo;
|
||||
use codex_protocol::protocol::InitialHistory;
|
||||
use codex_protocol::protocol::McpAuthStatus as CoreMcpAuthStatus;
|
||||
use codex_protocol::protocol::MultiAgentVersion;
|
||||
use codex_protocol::protocol::Op;
|
||||
use codex_protocol::protocol::RateLimitSnapshot as CoreRateLimitSnapshot;
|
||||
use codex_protocol::protocol::RealtimeVoicesList;
|
||||
|
||||
@@ -15,6 +15,10 @@ struct ThreadListFilters {
|
||||
use_state_db_only: bool,
|
||||
}
|
||||
|
||||
fn multi_agent_version_override(disable_multi_agent_tools: bool) -> Option<MultiAgentVersion> {
|
||||
disable_multi_agent_tools.then_some(MultiAgentVersion::Disabled)
|
||||
}
|
||||
|
||||
fn collect_resume_override_mismatches(
|
||||
request: &ThreadResumeParams,
|
||||
config_snapshot: &ThreadConfigSnapshot,
|
||||
@@ -828,6 +832,7 @@ impl ThreadRequestProcessor {
|
||||
ephemeral,
|
||||
session_start_source,
|
||||
thread_source,
|
||||
disable_multi_agent_tools,
|
||||
environments,
|
||||
} = params;
|
||||
if sandbox.is_some() && permissions.is_some() {
|
||||
@@ -879,6 +884,7 @@ impl ThreadRequestProcessor {
|
||||
dynamic_tools,
|
||||
session_start_source,
|
||||
thread_source.map(Into::into),
|
||||
disable_multi_agent_tools,
|
||||
environment_selections,
|
||||
service_name,
|
||||
experimental_raw_events,
|
||||
@@ -951,6 +957,7 @@ impl ThreadRequestProcessor {
|
||||
dynamic_tools: Option<Vec<ApiDynamicToolSpec>>,
|
||||
session_start_source: Option<codex_app_server_protocol::ThreadStartSource>,
|
||||
thread_source: Option<codex_protocol::protocol::ThreadSource>,
|
||||
disable_multi_agent_tools: bool,
|
||||
environments: Option<Vec<TurnEnvironmentSelection>>,
|
||||
service_name: Option<String>,
|
||||
experimental_raw_events: bool,
|
||||
@@ -1068,6 +1075,7 @@ impl ThreadRequestProcessor {
|
||||
},
|
||||
session_source: None,
|
||||
thread_source,
|
||||
multi_agent_version: multi_agent_version_override(disable_multi_agent_tools),
|
||||
dynamic_tools: core_dynamic_tools,
|
||||
metrics_service_name: service_name,
|
||||
parent_trace: request_trace,
|
||||
@@ -3145,6 +3153,7 @@ impl ThreadRequestProcessor {
|
||||
developer_instructions,
|
||||
ephemeral,
|
||||
thread_source,
|
||||
disable_multi_agent_tools,
|
||||
exclude_turns,
|
||||
} = params;
|
||||
let include_turns = !exclude_turns;
|
||||
@@ -3234,6 +3243,7 @@ impl ThreadRequestProcessor {
|
||||
history: history_items.clone(),
|
||||
rollout_path: source_thread.rollout_path.clone(),
|
||||
}),
|
||||
multi_agent_version_override(disable_multi_agent_tools),
|
||||
thread_source.map(Into::into),
|
||||
self.request_trace_context(&request_id).await,
|
||||
)
|
||||
|
||||
@@ -1100,6 +1100,7 @@ impl TurnRequestProcessor {
|
||||
history: parent_history.items,
|
||||
rollout_path: parent_thread.rollout_path(),
|
||||
}),
|
||||
/*multi_agent_version*/ None,
|
||||
/*thread_source*/ None,
|
||||
self.request_trace_context(request_id).await,
|
||||
)
|
||||
|
||||
@@ -178,6 +178,7 @@ pub struct StartThreadOptions {
|
||||
pub initial_history: InitialHistory,
|
||||
pub session_source: Option<SessionSource>,
|
||||
pub thread_source: Option<ThreadSource>,
|
||||
pub multi_agent_version: Option<MultiAgentVersion>,
|
||||
pub dynamic_tools: Vec<codex_protocol::dynamic_tools::DynamicToolSpec>,
|
||||
pub metrics_service_name: Option<String>,
|
||||
pub parent_trace: Option<W3cTraceContext>,
|
||||
@@ -572,6 +573,7 @@ impl ThreadManager {
|
||||
initial_history: InitialHistory::New,
|
||||
session_source: None,
|
||||
thread_source: None,
|
||||
multi_agent_version: None,
|
||||
dynamic_tools,
|
||||
metrics_service_name: None,
|
||||
parent_trace: None,
|
||||
@@ -608,6 +610,7 @@ impl ThreadManager {
|
||||
/*parent_thread_id*/ None,
|
||||
forked_from_thread_id,
|
||||
thread_source,
|
||||
options.multi_agent_version,
|
||||
options.dynamic_tools,
|
||||
options.metrics_service_name,
|
||||
/*inherited_shell_snapshot*/ None,
|
||||
@@ -696,6 +699,7 @@ impl ThreadManager {
|
||||
/*parent_thread_id*/ None,
|
||||
/*forked_from_thread_id*/ None,
|
||||
thread_source,
|
||||
/*multi_agent_version*/ None,
|
||||
Vec::new(),
|
||||
/*metrics_service_name*/ None,
|
||||
/*inherited_shell_snapshot*/ None,
|
||||
@@ -724,6 +728,7 @@ impl ThreadManager {
|
||||
/*parent_thread_id*/ None,
|
||||
/*forked_from_thread_id*/ None,
|
||||
/*thread_source*/ None,
|
||||
/*multi_agent_version*/ None,
|
||||
Vec::new(),
|
||||
/*metrics_service_name*/ None,
|
||||
/*parent_trace*/ None,
|
||||
@@ -757,6 +762,7 @@ impl ThreadManager {
|
||||
/*parent_thread_id*/ None,
|
||||
/*forked_from_thread_id*/ None,
|
||||
thread_source,
|
||||
/*multi_agent_version*/ None,
|
||||
Vec::new(),
|
||||
/*metrics_service_name*/ None,
|
||||
/*inherited_shell_snapshot*/ None,
|
||||
@@ -843,8 +849,15 @@ impl ThreadManager {
|
||||
{
|
||||
let snapshot = snapshot.into();
|
||||
let history = self.initial_history_from_rollout_path(path).await?;
|
||||
self.fork_thread_from_history(snapshot, config, history, thread_source, parent_trace)
|
||||
.await
|
||||
self.fork_thread_from_history(
|
||||
snapshot,
|
||||
config,
|
||||
history,
|
||||
/*multi_agent_version*/ None,
|
||||
thread_source,
|
||||
parent_trace,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn initial_history_from_rollout_path(
|
||||
@@ -871,6 +884,7 @@ impl ThreadManager {
|
||||
snapshot: S,
|
||||
config: Config,
|
||||
history: InitialHistory,
|
||||
multi_agent_version: Option<MultiAgentVersion>,
|
||||
thread_source: Option<ThreadSource>,
|
||||
parent_trace: Option<W3cTraceContext>,
|
||||
) -> CodexResult<NewThread>
|
||||
@@ -881,6 +895,7 @@ impl ThreadManager {
|
||||
snapshot.into(),
|
||||
config,
|
||||
history,
|
||||
multi_agent_version,
|
||||
thread_source,
|
||||
parent_trace,
|
||||
)
|
||||
@@ -892,6 +907,7 @@ impl ThreadManager {
|
||||
snapshot: ForkSnapshot,
|
||||
config: Config,
|
||||
history: InitialHistory,
|
||||
multi_agent_version: Option<MultiAgentVersion>,
|
||||
thread_source: Option<ThreadSource>,
|
||||
parent_trace: Option<W3cTraceContext>,
|
||||
) -> CodexResult<NewThread> {
|
||||
@@ -902,16 +918,20 @@ impl ThreadManager {
|
||||
InitialHistory::Forked(_) => history.forked_from_id(),
|
||||
InitialHistory::New | InitialHistory::Cleared => None,
|
||||
};
|
||||
let multi_agent_version = self
|
||||
.state
|
||||
.effective_multi_agent_version_for_spawn(
|
||||
&history,
|
||||
/*session_source*/ None,
|
||||
/*parent_thread_id*/ None,
|
||||
forked_from_thread_id,
|
||||
&config,
|
||||
)
|
||||
.await;
|
||||
let multi_agent_version = match multi_agent_version {
|
||||
Some(multi_agent_version) => multi_agent_version,
|
||||
None => {
|
||||
self.state
|
||||
.effective_multi_agent_version_for_spawn(
|
||||
&history,
|
||||
/*session_source*/ None,
|
||||
/*parent_thread_id*/ None,
|
||||
forked_from_thread_id,
|
||||
&config,
|
||||
)
|
||||
.await
|
||||
}
|
||||
};
|
||||
let interrupted_marker =
|
||||
InterruptedTurnHistoryMarker::from_config_and_version(&config, multi_agent_version);
|
||||
let history = fork_history_from_snapshot(snapshot, history, interrupted_marker);
|
||||
@@ -927,6 +947,7 @@ impl ThreadManager {
|
||||
/*parent_thread_id*/ None,
|
||||
forked_from_thread_id,
|
||||
thread_source,
|
||||
Some(multi_agent_version),
|
||||
Vec::new(),
|
||||
/*metrics_service_name*/ None,
|
||||
parent_trace,
|
||||
@@ -1130,6 +1151,7 @@ impl ThreadManagerState {
|
||||
parent_thread_id,
|
||||
forked_from_thread_id,
|
||||
thread_source,
|
||||
/*multi_agent_version*/ None,
|
||||
Vec::new(),
|
||||
metrics_service_name,
|
||||
inherited_shell_snapshot,
|
||||
@@ -1166,6 +1188,7 @@ impl ThreadManagerState {
|
||||
parent_thread_id,
|
||||
/*forked_from_thread_id*/ None,
|
||||
thread_source,
|
||||
/*multi_agent_version*/ None,
|
||||
Vec::new(),
|
||||
/*metrics_service_name*/ None,
|
||||
inherited_shell_snapshot,
|
||||
@@ -1203,6 +1226,7 @@ impl ThreadManagerState {
|
||||
parent_thread_id,
|
||||
forked_from_thread_id,
|
||||
thread_source,
|
||||
/*multi_agent_version*/ None,
|
||||
Vec::new(),
|
||||
/*metrics_service_name*/ None,
|
||||
inherited_shell_snapshot,
|
||||
@@ -1225,6 +1249,7 @@ impl ThreadManagerState {
|
||||
parent_thread_id: Option<ThreadId>,
|
||||
forked_from_thread_id: Option<ThreadId>,
|
||||
thread_source: Option<ThreadSource>,
|
||||
multi_agent_version: Option<MultiAgentVersion>,
|
||||
dynamic_tools: Vec<codex_protocol::dynamic_tools::DynamicToolSpec>,
|
||||
metrics_service_name: Option<String>,
|
||||
parent_trace: Option<W3cTraceContext>,
|
||||
@@ -1240,6 +1265,7 @@ impl ThreadManagerState {
|
||||
parent_thread_id,
|
||||
forked_from_thread_id,
|
||||
thread_source,
|
||||
multi_agent_version,
|
||||
dynamic_tools,
|
||||
metrics_service_name,
|
||||
/*inherited_shell_snapshot*/ None,
|
||||
@@ -1262,6 +1288,7 @@ impl ThreadManagerState {
|
||||
parent_thread_id: Option<ThreadId>,
|
||||
forked_from_thread_id: Option<ThreadId>,
|
||||
thread_source: Option<ThreadSource>,
|
||||
multi_agent_version: Option<MultiAgentVersion>,
|
||||
dynamic_tools: Vec<codex_protocol::dynamic_tools::DynamicToolSpec>,
|
||||
metrics_service_name: Option<String>,
|
||||
inherited_shell_snapshot: Option<Arc<ShellSnapshot>>,
|
||||
@@ -1298,16 +1325,17 @@ impl ThreadManagerState {
|
||||
.parent_rollout_thread_trace_for_source(&session_source, &initial_history)
|
||||
.await;
|
||||
let tracked_session_source = session_source.clone();
|
||||
let multi_agent_version = if thread_source == Some(ThreadSource::Side) {
|
||||
Some(MultiAgentVersion::Disabled)
|
||||
} else {
|
||||
self.initial_multi_agent_version_for_spawn(
|
||||
&initial_history,
|
||||
Some(&session_source),
|
||||
parent_thread_id,
|
||||
forked_from_thread_id,
|
||||
)
|
||||
.await
|
||||
let inherited_multi_agent_version = match multi_agent_version {
|
||||
Some(multi_agent_version) => Some(multi_agent_version),
|
||||
None => {
|
||||
self.initial_multi_agent_version_for_spawn(
|
||||
&initial_history,
|
||||
Some(&session_source),
|
||||
parent_thread_id,
|
||||
forked_from_thread_id,
|
||||
)
|
||||
.await
|
||||
}
|
||||
};
|
||||
let CodexSpawnOk {
|
||||
codex, thread_id, ..
|
||||
@@ -1338,7 +1366,7 @@ impl ThreadManagerState {
|
||||
analytics_events_client: self.analytics_events_client.clone(),
|
||||
thread_store: Arc::clone(&self.thread_store),
|
||||
attestation_provider: self.attestation_provider.clone(),
|
||||
inherited_multi_agent_version: multi_agent_version,
|
||||
inherited_multi_agent_version,
|
||||
}))
|
||||
.await?;
|
||||
let new_thread = self
|
||||
|
||||
@@ -324,6 +324,7 @@ async fn start_thread_rejects_explicit_local_environment_when_default_provider_i
|
||||
initial_history: InitialHistory::New,
|
||||
session_source: None,
|
||||
thread_source: None,
|
||||
multi_agent_version: None,
|
||||
dynamic_tools: Vec::new(),
|
||||
metrics_service_name: None,
|
||||
parent_trace: None,
|
||||
@@ -364,6 +365,7 @@ async fn start_thread_keeps_internal_threads_hidden_from_normal_lookups() {
|
||||
InternalSessionSource::MemoryConsolidation,
|
||||
)),
|
||||
thread_source: None,
|
||||
multi_agent_version: None,
|
||||
dynamic_tools: Vec::new(),
|
||||
metrics_service_name: None,
|
||||
parent_trace: None,
|
||||
@@ -419,6 +421,7 @@ async fn resume_and_fork_do_not_restore_thread_environments_from_rollout() {
|
||||
initial_history: InitialHistory::New,
|
||||
session_source: None,
|
||||
thread_source: None,
|
||||
multi_agent_version: None,
|
||||
dynamic_tools: Vec::new(),
|
||||
metrics_service_name: None,
|
||||
parent_trace: None,
|
||||
@@ -689,6 +692,7 @@ async fn resume_stopped_thread_from_rollout_preserves_thread_source() {
|
||||
initial_history: InitialHistory::New,
|
||||
session_source: None,
|
||||
thread_source: Some(ThreadSource::User),
|
||||
multi_agent_version: None,
|
||||
dynamic_tools: Vec::new(),
|
||||
metrics_service_name: None,
|
||||
parent_trace: None,
|
||||
|
||||
@@ -199,6 +199,7 @@ async fn fork_thread_from_history_does_not_require_source_rollout_path() {
|
||||
history: source_items.clone(),
|
||||
rollout_path: None,
|
||||
}),
|
||||
/*multi_agent_version*/ None,
|
||||
/*thread_source*/ None,
|
||||
/*parent_trace*/ None,
|
||||
)
|
||||
|
||||
@@ -753,6 +753,7 @@ async fn subagent_stop_replaces_stop_and_skips_internal_subagents() -> Result<()
|
||||
initial_history: InitialHistory::New,
|
||||
session_source: Some(SessionSource::SubAgent(SubAgentSource::Review)),
|
||||
thread_source: None,
|
||||
multi_agent_version: None,
|
||||
dynamic_tools: Vec::new(),
|
||||
metrics_service_name: None,
|
||||
parent_trace: None,
|
||||
|
||||
@@ -61,8 +61,8 @@ fn tool_names(body: &Value) -> Vec<String> {
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn side_threads_omit_multi_agent_tools_from_requests() -> Result<()> {
|
||||
const ROOT_USAGE_HINT: &str = "side threads must not receive root multi-agent guidance";
|
||||
async fn multi_agent_version_override_omits_multi_agent_tools_from_requests() -> Result<()> {
|
||||
const ROOT_USAGE_HINT: &str = "disabled threads must not receive root multi-agent guidance";
|
||||
|
||||
skip_if_no_network!(Ok(()));
|
||||
|
||||
@@ -88,13 +88,14 @@ async fn side_threads_omit_multi_agent_tools_from_requests() -> Result<()> {
|
||||
config.multi_agent_v2.root_agent_usage_hint_text = Some(ROOT_USAGE_HINT.to_string());
|
||||
});
|
||||
let test = builder.build(&server).await?;
|
||||
let side_thread = test
|
||||
let thread = test
|
||||
.thread_manager
|
||||
.start_thread_with_options(StartThreadOptions {
|
||||
config: test.config.clone(),
|
||||
initial_history: InitialHistory::New,
|
||||
session_source: None,
|
||||
thread_source: Some(ThreadSource::Side),
|
||||
thread_source: Some(ThreadSource::User),
|
||||
multi_agent_version: Some(MultiAgentVersion::Disabled),
|
||||
dynamic_tools: Vec::new(),
|
||||
metrics_service_name: None,
|
||||
parent_trace: None,
|
||||
@@ -102,11 +103,11 @@ async fn side_threads_omit_multi_agent_tools_from_requests() -> Result<()> {
|
||||
})
|
||||
.await?;
|
||||
assert_eq!(
|
||||
side_thread.thread.multi_agent_version(),
|
||||
thread.thread.multi_agent_version(),
|
||||
Some(MultiAgentVersion::Disabled)
|
||||
);
|
||||
|
||||
side_thread
|
||||
thread
|
||||
.thread
|
||||
.submit(Op::UserInput {
|
||||
items: vec![UserInput::Text {
|
||||
@@ -119,7 +120,7 @@ async fn side_threads_omit_multi_agent_tools_from_requests() -> Result<()> {
|
||||
thread_settings: Default::default(),
|
||||
})
|
||||
.await?;
|
||||
wait_for_event(&side_thread.thread, |event| {
|
||||
wait_for_event(&thread.thread, |event| {
|
||||
matches!(event, EventMsg::TurnComplete(_))
|
||||
})
|
||||
.await;
|
||||
|
||||
@@ -2534,7 +2534,6 @@ pub enum SessionSource {
|
||||
#[ts(rename_all = "snake_case")]
|
||||
pub enum ThreadSource {
|
||||
User,
|
||||
Side,
|
||||
Subagent,
|
||||
MemoryConsolidation,
|
||||
}
|
||||
@@ -2543,7 +2542,6 @@ impl ThreadSource {
|
||||
pub fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
ThreadSource::User => "user",
|
||||
ThreadSource::Side => "side",
|
||||
ThreadSource::Subagent => "subagent",
|
||||
ThreadSource::MemoryConsolidation => "memory_consolidation",
|
||||
}
|
||||
@@ -2562,7 +2560,6 @@ impl FromStr for ThreadSource {
|
||||
fn from_str(value: &str) -> Result<Self, Self::Err> {
|
||||
match value {
|
||||
"user" => Ok(ThreadSource::User),
|
||||
"side" => Ok(ThreadSource::Side),
|
||||
"subagent" => Ok(ThreadSource::Subagent),
|
||||
"memory_consolidation" => Ok(ThreadSource::MemoryConsolidation),
|
||||
other => Err(format!("unknown thread source: {other}")),
|
||||
|
||||
@@ -19,6 +19,7 @@ use crate::app_event_sender::AppEventSender;
|
||||
use crate::app_server_session::AppServerBootstrap;
|
||||
use crate::app_server_session::AppServerSession;
|
||||
use crate::app_server_session::AppServerStartedThread;
|
||||
use crate::app_server_session::MultiAgentToolsOverride;
|
||||
use crate::app_server_session::TurnPermissionsOverride;
|
||||
use crate::app_server_session::app_server_rate_limit_snapshots;
|
||||
use crate::bottom_pane::AppLinkViewParams;
|
||||
@@ -961,7 +962,11 @@ impl App {
|
||||
&[("source", "cli_subcommand")],
|
||||
);
|
||||
let forked = app_server
|
||||
.fork_thread(config.clone(), target_session.thread_id, ThreadSource::User)
|
||||
.fork_thread(
|
||||
config.clone(),
|
||||
target_session.thread_id,
|
||||
MultiAgentToolsOverride::Inherit,
|
||||
)
|
||||
.await
|
||||
.map_err(|err| session_start_error("fork", &target_session, err))?;
|
||||
let init = crate::chatwidget::ChatWidgetInit {
|
||||
|
||||
@@ -145,7 +145,11 @@ impl App {
|
||||
self.refresh_in_memory_config_from_disk_best_effort("forking the thread")
|
||||
.await;
|
||||
match app_server
|
||||
.fork_thread(self.config.clone(), thread_id, ThreadSource::User)
|
||||
.fork_thread(
|
||||
self.config.clone(),
|
||||
thread_id,
|
||||
MultiAgentToolsOverride::Inherit,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(forked) => {
|
||||
|
||||
@@ -565,7 +565,11 @@ impl App {
|
||||
|
||||
let fork_config = self.side_fork_config();
|
||||
match app_server
|
||||
.fork_thread(fork_config, parent_thread_id, ThreadSource::Side)
|
||||
.fork_thread(
|
||||
fork_config,
|
||||
parent_thread_id,
|
||||
MultiAgentToolsOverride::Disabled,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(forked) => {
|
||||
|
||||
@@ -184,6 +184,12 @@ pub(crate) enum ThreadParamsMode {
|
||||
Remote,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(crate) enum MultiAgentToolsOverride {
|
||||
Inherit,
|
||||
Disabled,
|
||||
}
|
||||
|
||||
impl ThreadParamsMode {
|
||||
fn model_provider_from_config(self, config: &Config) -> Option<String> {
|
||||
match self {
|
||||
@@ -445,7 +451,7 @@ impl AppServerSession {
|
||||
&mut self,
|
||||
config: Config,
|
||||
thread_id: ThreadId,
|
||||
thread_source: ThreadSource,
|
||||
multi_agent_tools: MultiAgentToolsOverride,
|
||||
) -> Result<AppServerStartedThread> {
|
||||
let request_id = self.next_request_id();
|
||||
let session_config = self.session_config_with_effective_service_tier(&config);
|
||||
@@ -458,7 +464,7 @@ impl AppServerSession {
|
||||
thread_id,
|
||||
self.thread_params_mode(),
|
||||
self.remote_cwd_override.as_deref(),
|
||||
thread_source,
|
||||
multi_agent_tools,
|
||||
),
|
||||
})
|
||||
.await
|
||||
@@ -1463,7 +1469,7 @@ fn thread_fork_params_from_config(
|
||||
thread_id: ThreadId,
|
||||
thread_params_mode: ThreadParamsMode,
|
||||
remote_cwd_override: Option<&std::path::Path>,
|
||||
thread_source: ThreadSource,
|
||||
multi_agent_tools: MultiAgentToolsOverride,
|
||||
) -> ThreadForkParams {
|
||||
let permissions = permissions_selection_from_config(&config, thread_params_mode);
|
||||
let sandbox = permissions
|
||||
@@ -1493,7 +1499,8 @@ fn thread_fork_params_from_config(
|
||||
config.developer_instructions.clone(),
|
||||
),
|
||||
ephemeral: config.ephemeral,
|
||||
thread_source: Some(thread_source),
|
||||
thread_source: Some(ThreadSource::User),
|
||||
disable_multi_agent_tools: matches!(multi_agent_tools, MultiAgentToolsOverride::Disabled),
|
||||
..ThreadForkParams::default()
|
||||
}
|
||||
}
|
||||
@@ -2019,7 +2026,7 @@ mod tests {
|
||||
thread_id,
|
||||
ThreadParamsMode::Remote,
|
||||
/*remote_cwd_override*/ None,
|
||||
ThreadSource::User,
|
||||
MultiAgentToolsOverride::Inherit,
|
||||
);
|
||||
|
||||
assert_eq!(start.cwd, None);
|
||||
@@ -2137,7 +2144,7 @@ mod tests {
|
||||
thread_id,
|
||||
ThreadParamsMode::Remote,
|
||||
Some(remote_cwd.as_path()),
|
||||
ThreadSource::User,
|
||||
MultiAgentToolsOverride::Inherit,
|
||||
);
|
||||
|
||||
assert_eq!(start.cwd.as_deref(), Some("repo/on/server"));
|
||||
@@ -2189,7 +2196,7 @@ mod tests {
|
||||
thread_id,
|
||||
ThreadParamsMode::Embedded,
|
||||
/*remote_cwd_override*/ None,
|
||||
ThreadSource::User,
|
||||
MultiAgentToolsOverride::Inherit,
|
||||
);
|
||||
|
||||
let expected_service_tier = Some(Some(ServiceTier::Fast.request_value().to_string()));
|
||||
@@ -2232,7 +2239,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn thread_fork_params_forward_instruction_overrides() {
|
||||
async fn thread_fork_params_forward_instruction_and_multi_agent_overrides() {
|
||||
let temp_dir = tempfile::tempdir().expect("tempdir");
|
||||
let mut config = build_config(&temp_dir).await;
|
||||
config.base_instructions = Some("Base override.".to_string());
|
||||
@@ -2244,7 +2251,7 @@ mod tests {
|
||||
thread_id,
|
||||
ThreadParamsMode::Embedded,
|
||||
/*remote_cwd_override*/ None,
|
||||
ThreadSource::Side,
|
||||
MultiAgentToolsOverride::Disabled,
|
||||
);
|
||||
|
||||
assert_eq!(params.base_instructions.as_deref(), Some("Base override."));
|
||||
@@ -2252,7 +2259,8 @@ mod tests {
|
||||
params.developer_instructions.as_deref(),
|
||||
Some("Developer override.")
|
||||
);
|
||||
assert_eq!(params.thread_source, Some(ThreadSource::Side));
|
||||
assert_eq!(params.thread_source, Some(ThreadSource::User));
|
||||
assert!(params.disable_multi_agent_tools);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -2279,7 +2287,7 @@ mod tests {
|
||||
thread_id,
|
||||
ThreadParamsMode::Embedded,
|
||||
/*remote_cwd_override*/ None,
|
||||
ThreadSource::User,
|
||||
MultiAgentToolsOverride::Inherit,
|
||||
);
|
||||
|
||||
assert_eq!(control_start.developer_instructions, None);
|
||||
@@ -2309,7 +2317,7 @@ mod tests {
|
||||
thread_id,
|
||||
ThreadParamsMode::Embedded,
|
||||
/*remote_cwd_override*/ None,
|
||||
ThreadSource::User,
|
||||
MultiAgentToolsOverride::Inherit,
|
||||
);
|
||||
let expected = format!(
|
||||
"Developer override.\n\n{}",
|
||||
|
||||
Reference in New Issue
Block a user