From aea38f0f882c081421d48de2a95ed160f4856e2e Mon Sep 17 00:00:00 2001 From: sayan-oai Date: Tue, 3 Feb 2026 09:12:37 -0800 Subject: [PATCH] fix WebSearchAction type clash between v1 and v2 (#10408) type clash; app-server generated types were still using the v1 snake_case `WebSearchAction`, so there was a mismatch between the camelCase emitted types and the snake_case types we were trying to parse. Updated v2 `WebSearchAction` to export into the `v2/` type set and updated `ThreadItem` to use that. ### Tests Ran new `just write-app-server-schema` to surface changes to schema, the import looks correct now. --- .../app-server-protocol/schema/typescript/v2/ThreadItem.ts | 2 +- .../schema/typescript/v2/WebSearchAction.ts | 5 +++++ codex-rs/app-server-protocol/schema/typescript/v2/index.ts | 1 + codex-rs/app-server-protocol/src/protocol/v2.rs | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 codex-rs/app-server-protocol/schema/typescript/v2/WebSearchAction.ts diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts index cd2faf65b..fa098ed3e 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts @@ -1,7 +1,6 @@ // GENERATED CODE! DO NOT MODIFY BY HAND! // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { WebSearchAction } from "../WebSearchAction"; import type { JsonValue } from "../serde_json/JsonValue"; import type { CollabAgentState } from "./CollabAgentState"; import type { CollabAgentTool } from "./CollabAgentTool"; @@ -14,6 +13,7 @@ import type { McpToolCallResult } from "./McpToolCallResult"; import type { McpToolCallStatus } from "./McpToolCallStatus"; import type { PatchApplyStatus } from "./PatchApplyStatus"; import type { UserInput } from "./UserInput"; +import type { WebSearchAction } from "./WebSearchAction"; export type ThreadItem = { "type": "userMessage", id: string, content: Array, } | { "type": "agentMessage", id: string, text: string, } | { "type": "plan", id: string, text: string, } | { "type": "reasoning", id: string, summary: Array, content: Array, } | { "type": "commandExecution", id: string, /** diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/WebSearchAction.ts b/codex-rs/app-server-protocol/schema/typescript/v2/WebSearchAction.ts new file mode 100644 index 000000000..309bff454 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/v2/WebSearchAction.ts @@ -0,0 +1,5 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type WebSearchAction = { "type": "search", query: string | null, queries: Array | null, } | { "type": "openPage", url: string | null, } | { "type": "findInPage", url: string | null, pattern: string | null, } | { "type": "other" }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/index.ts b/codex-rs/app-server-protocol/schema/typescript/v2/index.ts index 10b60a45f..0c50231a8 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/index.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/index.ts @@ -169,5 +169,6 @@ export type { TurnStartResponse } from "./TurnStartResponse"; export type { TurnStartedNotification } from "./TurnStartedNotification"; export type { TurnStatus } from "./TurnStatus"; export type { UserInput } from "./UserInput"; +export type { WebSearchAction } from "./WebSearchAction"; export type { WindowsWorldWritableWarningNotification } from "./WindowsWorldWritableWarningNotification"; export type { WriteStatus } from "./WriteStatus"; diff --git a/codex-rs/app-server-protocol/src/protocol/v2.rs b/codex-rs/app-server-protocol/src/protocol/v2.rs index 19db13723..431be8219 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -2170,6 +2170,7 @@ pub enum ThreadItem { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] #[serde(tag = "type", rename_all = "camelCase")] #[ts(tag = "type", rename_all = "camelCase")] +#[ts(export_to = "v2/")] pub enum WebSearchAction { Search { query: Option,