From ececf1a6ff9cb41a239f44ba680e672cbc060b20 Mon Sep 17 00:00:00 2001 From: Mark Steinbrick Date: Sun, 7 Jun 2026 23:30:54 -0700 Subject: [PATCH] Expand thread source taxonomy --- .../schema/json/ClientRequest.json | 3 +++ .../schema/json/ServerNotification.json | 3 +++ .../json/codex_app_server_protocol.schemas.json | 3 +++ .../json/codex_app_server_protocol.v2.schemas.json | 3 +++ .../schema/json/v2/ThreadForkParams.json | 3 +++ .../schema/json/v2/ThreadForkResponse.json | 3 +++ .../schema/json/v2/ThreadListResponse.json | 3 +++ .../schema/json/v2/ThreadMetadataUpdateResponse.json | 3 +++ .../schema/json/v2/ThreadReadResponse.json | 3 +++ .../schema/json/v2/ThreadResumeResponse.json | 3 +++ .../schema/json/v2/ThreadRollbackResponse.json | 3 +++ .../schema/json/v2/ThreadStartParams.json | 3 +++ .../schema/json/v2/ThreadStartResponse.json | 3 +++ .../schema/json/v2/ThreadStartedNotification.json | 3 +++ .../schema/json/v2/ThreadUnarchiveResponse.json | 3 +++ .../schema/typescript/v2/ThreadSource.ts | 5 ++++- .../src/protocol/v2/thread_data.rs | 12 ++++++++++++ codex-rs/protocol/src/protocol.rs | 12 ++++++++++++ 18 files changed, 73 insertions(+), 1 deletion(-) diff --git a/codex-rs/app-server-protocol/schema/json/ClientRequest.json b/codex-rs/app-server-protocol/schema/json/ClientRequest.json index 6d9be4ec02..98ee2b398e 100644 --- a/codex-rs/app-server-protocol/schema/json/ClientRequest.json +++ b/codex-rs/app-server-protocol/schema/json/ClientRequest.json @@ -3795,9 +3795,12 @@ "type": "string" }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/ServerNotification.json b/codex-rs/app-server-protocol/schema/json/ServerNotification.json index dac3a4fdff..be0863de9f 100644 --- a/codex-rs/app-server-protocol/schema/json/ServerNotification.json +++ b/codex-rs/app-server-protocol/schema/json/ServerNotification.json @@ -4575,9 +4575,12 @@ "type": "object" }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 1873ed317e..c1caf2ccf7 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -18017,9 +18017,12 @@ "type": "string" }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 38c74b1859..45688357a9 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -15834,9 +15834,12 @@ "type": "string" }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkParams.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkParams.json index d9a543e939..bc6bb212f7 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkParams.json @@ -73,9 +73,12 @@ "type": "string" }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json index 0dbb7ef004..ad851a7bef 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadForkResponse.json @@ -1790,9 +1790,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json index 903553afaa..04ed41ebbd 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadListResponse.json @@ -1605,9 +1605,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json index 93f44759bf..28448a2a19 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadMetadataUpdateResponse.json @@ -1605,9 +1605,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json index a78d1837c8..5c2eccc8d3 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadReadResponse.json @@ -1605,9 +1605,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json index 288c3e6c8e..5dc8aa8f36 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeResponse.json @@ -1790,9 +1790,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json index 2ef7959a8b..0d34729f74 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadRollbackResponse.json @@ -1605,9 +1605,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartParams.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartParams.json index 99b25490ab..2039dc3af6 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartParams.json @@ -107,9 +107,12 @@ "type": "string" }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json index 1a182e5d69..cb2dd07fda 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartResponse.json @@ -1790,9 +1790,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json index 66ed134c83..58aceaea06 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadStartedNotification.json @@ -1605,9 +1605,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json index d331fa9bf7..f3ed5c2ce5 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadUnarchiveResponse.json @@ -1605,9 +1605,12 @@ ] }, "ThreadSource": { + "description": "Optional caller-supplied classification of who or what owns a thread's execution.", "enum": [ "user", "subagent", + "system", + "automation", "memory_consolidation" ], "type": "string" diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadSource.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadSource.ts index 8f55524801..290e98bef8 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadSource.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadSource.ts @@ -2,4 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type ThreadSource = "user" | "subagent" | "memory_consolidation"; +/** + * Optional caller-supplied classification of who or what owns a thread's execution. + */ +export type ThreadSource = "user" | "subagent" | "system" | "automation" | "memory_consolidation"; diff --git a/codex-rs/app-server-protocol/src/protocol/v2/thread_data.rs b/codex-rs/app-server-protocol/src/protocol/v2/thread_data.rs index 35b6183871..c18efea237 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2/thread_data.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2/thread_data.rs @@ -61,12 +61,20 @@ impl From for CoreSessionSource { } } +/// Optional caller-supplied classification of who or what owns a thread's execution. #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] #[serde(rename_all = "snake_case")] #[ts(rename_all = "snake_case", export_to = "v2/")] pub enum ThreadSource { + // Primary work attributed to an active user workflow. User, + // Work delegated by an agent into a child or worker thread. Subagent, + // Product-owned helper, safety, repair, or auxiliary work. + System, + // Top-level work started by a schedule or autonomous trigger. + Automation, + // Internal memory-consolidation work. MemoryConsolidation, } @@ -75,6 +83,8 @@ impl From for ThreadSource { match value { CoreThreadSource::User => ThreadSource::User, CoreThreadSource::Subagent => ThreadSource::Subagent, + CoreThreadSource::System => ThreadSource::System, + CoreThreadSource::Automation => ThreadSource::Automation, CoreThreadSource::MemoryConsolidation => ThreadSource::MemoryConsolidation, } } @@ -85,6 +95,8 @@ impl From for CoreThreadSource { match value { ThreadSource::User => CoreThreadSource::User, ThreadSource::Subagent => CoreThreadSource::Subagent, + ThreadSource::System => CoreThreadSource::System, + ThreadSource::Automation => CoreThreadSource::Automation, ThreadSource::MemoryConsolidation => CoreThreadSource::MemoryConsolidation, } } diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index c9e2e8bb28..0921c1c634 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -2495,12 +2495,20 @@ pub enum SessionSource { Unknown, } +/// Optional caller-supplied classification of who or what owns a thread's execution. #[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, JsonSchema, TS)] #[serde(rename_all = "snake_case")] #[ts(rename_all = "snake_case")] pub enum ThreadSource { + // Primary work attributed to an active user workflow. User, + // Work delegated by an agent into a child or worker thread. Subagent, + // Product-owned helper, safety, repair, or auxiliary work. + System, + // Top-level work started by a schedule or autonomous trigger. + Automation, + // Internal memory-consolidation work. MemoryConsolidation, } @@ -2509,6 +2517,8 @@ impl ThreadSource { match self { ThreadSource::User => "user", ThreadSource::Subagent => "subagent", + ThreadSource::System => "system", + ThreadSource::Automation => "automation", ThreadSource::MemoryConsolidation => "memory_consolidation", } } @@ -2527,6 +2537,8 @@ impl FromStr for ThreadSource { match value { "user" => Ok(ThreadSource::User), "subagent" => Ok(ThreadSource::Subagent), + "system" => Ok(ThreadSource::System), + "automation" => Ok(ThreadSource::Automation), "memory_consolidation" => Ok(ThreadSource::MemoryConsolidation), other => Err(format!("unknown thread source: {other}")), }