From e1f9d57bc86ade56004610aa26b3698b8a5e5272 Mon Sep 17 00:00:00 2001 From: Roy Han Date: Thu, 26 Mar 2026 00:41:48 -0700 Subject: [PATCH] schema cleanup --- .../schema/json/ClientRequest.json | 18 ++++++++++++++++++ .../codex_app_server_protocol.schemas.json | 18 ++++++++++++++++++ .../codex_app_server_protocol.v2.schemas.json | 18 ++++++++++++++++++ .../schema/json/v2/TurnStartParams.json | 18 ++++++++++++++++++ .../schema/typescript/index.ts | 1 + .../schema/typescript/v2/TurnStartParams.ts | 4 ++++ codex-rs/core/tests/suite/items.rs | 2 +- codex-rs/tui_app_server/src/chatwidget.rs | 2 +- 8 files changed, 79 insertions(+), 2 deletions(-) diff --git a/codex-rs/app-server-protocol/schema/json/ClientRequest.json b/codex-rs/app-server-protocol/schema/json/ClientRequest.json index 9227a97d55..4491cce879 100644 --- a/codex-rs/app-server-protocol/schema/json/ClientRequest.json +++ b/codex-rs/app-server-protocol/schema/json/ClientRequest.json @@ -2457,6 +2457,13 @@ }, "type": "object" }, + "SubmissionType": { + "enum": [ + "prompt", + "prompt_queued" + ], + "type": "string" + }, "TextElement": { "properties": { "byteRange": { @@ -3225,6 +3232,17 @@ ], "description": "Override the service tier for this turn and subsequent turns." }, + "submissionType": { + "anyOf": [ + { + "$ref": "#/definitions/SubmissionType" + }, + { + "type": "null" + } + ], + "description": "Classify the primary input message submitted with `turn/start`." + }, "summary": { "anyOf": [ { 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 d4269f5239..0819c7a7fd 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 @@ -11888,6 +11888,13 @@ } ] }, + "SubmissionType": { + "enum": [ + "prompt", + "prompt_queued" + ], + "type": "string" + }, "TerminalInteractionNotification": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -14418,6 +14425,17 @@ ], "description": "Override the service tier for this turn and subsequent turns." }, + "submissionType": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SubmissionType" + }, + { + "type": "null" + } + ], + "description": "Classify the primary input message submitted with `turn/start`." + }, "summary": { "anyOf": [ { 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 acf36d6c3c..8a542f608c 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 @@ -9635,6 +9635,13 @@ } ] }, + "SubmissionType": { + "enum": [ + "prompt", + "prompt_queued" + ], + "type": "string" + }, "TerminalInteractionNotification": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -12165,6 +12172,17 @@ ], "description": "Override the service tier for this turn and subsequent turns." }, + "submissionType": { + "anyOf": [ + { + "$ref": "#/definitions/SubmissionType" + }, + { + "type": "null" + } + ], + "description": "Classify the primary input message submitted with `turn/start`." + }, "summary": { "anyOf": [ { diff --git a/codex-rs/app-server-protocol/schema/json/v2/TurnStartParams.json b/codex-rs/app-server-protocol/schema/json/v2/TurnStartParams.json index cad1d8b5bc..415ae7ce3b 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/TurnStartParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/TurnStartParams.json @@ -354,6 +354,13 @@ ], "type": "object" }, + "SubmissionType": { + "enum": [ + "prompt", + "prompt_queued" + ], + "type": "string" + }, "TextElement": { "properties": { "byteRange": { @@ -595,6 +602,17 @@ ], "description": "Override the service tier for this turn and subsequent turns." }, + "submissionType": { + "anyOf": [ + { + "$ref": "#/definitions/SubmissionType" + }, + { + "type": "null" + } + ], + "description": "Classify the primary input message submitted with `turn/start`." + }, "summary": { "anyOf": [ { diff --git a/codex-rs/app-server-protocol/schema/typescript/index.ts b/codex-rs/app-server-protocol/schema/typescript/index.ts index 777feaa56e..65defba9f0 100644 --- a/codex-rs/app-server-protocol/schema/typescript/index.ts +++ b/codex-rs/app-server-protocol/schema/typescript/index.ts @@ -67,6 +67,7 @@ export type { ServiceTier } from "./ServiceTier"; export type { SessionSource } from "./SessionSource"; export type { Settings } from "./Settings"; export type { SubAgentSource } from "./SubAgentSource"; +export type { SubmissionType } from "./SubmissionType"; export type { ThreadId } from "./ThreadId"; export type { Tool } from "./Tool"; export type { Verbosity } from "./Verbosity"; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/TurnStartParams.ts b/codex-rs/app-server-protocol/schema/typescript/v2/TurnStartParams.ts index 8f57a5e68b..110451d77f 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/TurnStartParams.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/TurnStartParams.ts @@ -6,6 +6,7 @@ import type { Personality } from "../Personality"; import type { ReasoningEffort } from "../ReasoningEffort"; import type { ReasoningSummary } from "../ReasoningSummary"; import type { ServiceTier } from "../ServiceTier"; +import type { SubmissionType } from "../SubmissionType"; import type { JsonValue } from "../serde_json/JsonValue"; import type { ApprovalsReviewer } from "./ApprovalsReviewer"; import type { AskForApproval } from "./AskForApproval"; @@ -41,6 +42,9 @@ summary?: ReasoningSummary | null, /** * Override the personality for this turn and subsequent turns. */ personality?: Personality | null, /** + * Classify the primary input message submitted with `turn/start`. + */ +submissionType?: SubmissionType | null, /** * Optional JSON Schema used to constrain the final assistant message for * this turn. */ diff --git a/codex-rs/core/tests/suite/items.rs b/codex-rs/core/tests/suite/items.rs index 74809e182d..63ecbdf976 100644 --- a/codex-rs/core/tests/suite/items.rs +++ b/codex-rs/core/tests/suite/items.rs @@ -217,7 +217,7 @@ async fn user_turn_tracks_turn_metadata_analytics() -> anyhow::Result<()> { event_params["product_client_id"], serde_json::json!(codex_core::default_client::originator().value) ); - assert_eq!(event_params["submission_type"], "prompt"); + assert_eq!(event_params["submission_type"], "default"); assert_eq!(event_params["model"], session_configured.model); assert_eq!(event_params["model_provider"], config.model_provider_id); assert_eq!(event_params["reasoning_effort"], "high"); diff --git a/codex-rs/tui_app_server/src/chatwidget.rs b/codex-rs/tui_app_server/src/chatwidget.rs index 582dfcb82c..5d9589ea34 100644 --- a/codex-rs/tui_app_server/src/chatwidget.rs +++ b/codex-rs/tui_app_server/src/chatwidget.rs @@ -5327,7 +5327,7 @@ impl ChatWidget { } fn submit_user_message(&mut self, user_message: UserMessage) { - self.submit_user_message_with_type(user_message, None); + self.submit_user_message_with_type(user_message, /*submission_type*/ None); } fn submit_user_message_with_type(