From 9a55ee8fcd8123cc2af44c8e90ba556539e50d36 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Wed, 7 Jan 2026 13:34:35 -0800 Subject: [PATCH 01/16] Update CI Rust toolchain to 1.92 --- .github/workflows/rust-ci.yml | 8 ++++---- .github/workflows/rust-release.yml | 2 +- .github/workflows/sdk.yml | 2 +- .github/workflows/shell-tool-mcp.yml | 2 +- codex-rs/rust-toolchain.toml | 2 +- codex-rs/scripts/setup-windows.ps1 | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 1af0bf2f4aeb..cc7537836aa1 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -59,7 +59,7 @@ jobs: working-directory: codex-rs steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.92 with: components: rustfmt - name: cargo fmt @@ -77,7 +77,7 @@ jobs: working-directory: codex-rs steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.92 - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: cargo-shear @@ -150,7 +150,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.92 with: targets: ${{ matrix.target }} components: clippy @@ -392,7 +392,7 @@ jobs: - name: Install DotSlash uses: facebook/install-dotslash@v2 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.92 with: targets: ${{ matrix.target }} diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 6d1606d2cfc6..739335a43180 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -80,7 +80,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.92 with: targets: ${{ matrix.target }} diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index 3e5a249d40c6..f506dce6ba1b 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -24,7 +24,7 @@ jobs: node-version: 22 cache: pnpm - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.92 - name: build codex run: cargo build --bin codex diff --git a/.github/workflows/shell-tool-mcp.yml b/.github/workflows/shell-tool-mcp.yml index b27b4bdbd45e..bc49a90fa6a6 100644 --- a/.github/workflows/shell-tool-mcp.yml +++ b/.github/workflows/shell-tool-mcp.yml @@ -93,7 +93,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.92 with: targets: ${{ matrix.target }} diff --git a/codex-rs/rust-toolchain.toml b/codex-rs/rust-toolchain.toml index 7187a33189ea..05eeaac960ae 100644 --- a/codex-rs/rust-toolchain.toml +++ b/codex-rs/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.90.0" +channel = "1.92.0" components = ["clippy", "rustfmt", "rust-src"] diff --git a/codex-rs/scripts/setup-windows.ps1 b/codex-rs/scripts/setup-windows.ps1 index 554dc633526f..33b6b0c35226 100644 --- a/codex-rs/scripts/setup-windows.ps1 +++ b/codex-rs/scripts/setup-windows.ps1 @@ -179,7 +179,7 @@ if (-not (Ensure-Command 'cargo')) { Write-Host "==> Configuring Rust toolchain per rust-toolchain.toml" -ForegroundColor Cyan # Pin to the workspace toolchain and install components -$toolchain = '1.90.0' +$toolchain = '1.92.0' & rustup toolchain install $toolchain --profile minimal | Out-Host & rustup default $toolchain | Out-Host & rustup component add clippy rustfmt rust-src --toolchain $toolchain | Out-Host From 645e6b1810c64f83d4b404a8008ef930d3b479bb Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Wed, 7 Jan 2026 13:42:05 -0800 Subject: [PATCH 02/16] Derive default for ExecCommandSource --- codex-rs/protocol/src/protocol.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index e3748bafc6be..709b3c48e860 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -1486,21 +1486,16 @@ pub struct ReviewLineRange { pub end: u32, } -#[derive(Debug, Clone, Copy, Display, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)] +#[derive(Debug, Clone, Copy, Display, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS, Default)] #[serde(rename_all = "snake_case")] pub enum ExecCommandSource { + #[default] Agent, UserShell, UnifiedExecStartup, UnifiedExecInteraction, } -impl Default for ExecCommandSource { - fn default() -> Self { - Self::Agent - } -} - #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] pub struct ExecCommandBeginEvent { /// Identifier so this can be paired with the ExecCommandEnd event. From 154fc76abe34096c49018862d2bacdf5cdd51f41 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Wed, 7 Jan 2026 13:59:54 -0800 Subject: [PATCH 03/16] Derive default for PlanType --- .../src/models/rate_limit_status_payload.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs b/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs index 0f5caf52ff52..fff164a15932 100644 --- a/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs +++ b/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs @@ -42,9 +42,10 @@ impl RateLimitStatusPayload { } } -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default)] pub enum PlanType { #[serde(rename = "guest")] + #[default] Guest, #[serde(rename = "free")] Free, @@ -71,9 +72,3 @@ pub enum PlanType { #[serde(rename = "edu")] Edu, } - -impl Default for PlanType { - fn default() -> PlanType { - Self::Guest - } -} From be6ce0d39e72f2742afe545e44d2c257baf8a07c Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Wed, 7 Jan 2026 14:00:06 -0800 Subject: [PATCH 04/16] Derive defaults for core enums --- codex-rs/core/src/config/types.rs | 9 ++------- codex-rs/core/src/tools/handlers/read_file.rs | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/codex-rs/core/src/config/types.rs b/codex-rs/core/src/config/types.rs index 6c421d4608f4..5695af4ec47a 100644 --- a/codex-rs/core/src/config/types.rs +++ b/codex-rs/core/src/config/types.rs @@ -377,10 +377,11 @@ impl Default for Notifications { /// Terminals generally encode both mouse wheels and trackpads as the same "scroll up/down" mouse /// button events, without a magnitude. This setting controls whether Codex uses a heuristic to /// infer wheel vs trackpad per stream, or forces a specific behavior. -#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Default)] #[serde(rename_all = "snake_case")] pub enum ScrollInputMode { /// Infer wheel vs trackpad behavior per scroll stream. + #[default] Auto, /// Always treat scroll events as mouse-wheel input (fixed lines per tick). Wheel, @@ -388,12 +389,6 @@ pub enum ScrollInputMode { Trackpad, } -impl Default for ScrollInputMode { - fn default() -> Self { - Self::Auto - } -} - /// Collection of settings that are specific to the TUI. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)] pub struct Tui { diff --git a/codex-rs/core/src/tools/handlers/read_file.rs b/codex-rs/core/src/tools/handlers/read_file.rs index 58b6ea6888be..5d9ccbc4deec 100644 --- a/codex-rs/core/src/tools/handlers/read_file.rs +++ b/codex-rs/core/src/tools/handlers/read_file.rs @@ -39,9 +39,10 @@ struct ReadFileArgs { indentation: Option, } -#[derive(Deserialize)] +#[derive(Deserialize, Default)] #[serde(rename_all = "snake_case")] enum ReadMode { + #[default] Slice, Indentation, } @@ -464,12 +465,6 @@ mod defaults { } } - impl Default for ReadMode { - fn default() -> Self { - Self::Slice - } - } - pub fn offset() -> usize { 1 } From 141199be523185ff23b14a32429f90388bfd4a44 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Thu, 15 Jan 2026 22:34:12 -0800 Subject: [PATCH 05/16] Revert non-toolchain changes from merge --- .../src/models/rate_limit_status_payload.rs | 9 +++++++-- codex-rs/core/src/config/types.rs | 9 +++++++-- codex-rs/core/src/tools/handlers/read_file.rs | 9 +++++++-- codex-rs/protocol/src/protocol.rs | 9 +++++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs b/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs index fff164a15932..0f5caf52ff52 100644 --- a/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs +++ b/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs @@ -42,10 +42,9 @@ impl RateLimitStatusPayload { } } -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default)] +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum PlanType { #[serde(rename = "guest")] - #[default] Guest, #[serde(rename = "free")] Free, @@ -72,3 +71,9 @@ pub enum PlanType { #[serde(rename = "edu")] Edu, } + +impl Default for PlanType { + fn default() -> PlanType { + Self::Guest + } +} diff --git a/codex-rs/core/src/config/types.rs b/codex-rs/core/src/config/types.rs index e9e81cb42a4d..981f9b541aa8 100644 --- a/codex-rs/core/src/config/types.rs +++ b/codex-rs/core/src/config/types.rs @@ -423,11 +423,10 @@ impl Default for Notifications { /// Terminals generally encode both mouse wheels and trackpads as the same "scroll up/down" mouse /// button events, without a magnitude. This setting controls whether Codex uses a heuristic to /// infer wheel vs trackpad per stream, or forces a specific behavior. -#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Default, JsonSchema)] +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "snake_case")] pub enum ScrollInputMode { /// Infer wheel vs trackpad behavior per scroll stream. - #[default] Auto, /// Always treat scroll events as mouse-wheel input (fixed lines per tick). Wheel, @@ -435,6 +434,12 @@ pub enum ScrollInputMode { Trackpad, } +impl Default for ScrollInputMode { + fn default() -> Self { + Self::Auto + } +} + /// Collection of settings that are specific to the TUI. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema)] #[schemars(deny_unknown_fields)] diff --git a/codex-rs/core/src/tools/handlers/read_file.rs b/codex-rs/core/src/tools/handlers/read_file.rs index eb5ce647ce34..4f187540a6e1 100644 --- a/codex-rs/core/src/tools/handlers/read_file.rs +++ b/codex-rs/core/src/tools/handlers/read_file.rs @@ -40,10 +40,9 @@ struct ReadFileArgs { indentation: Option, } -#[derive(Deserialize, Default)] +#[derive(Deserialize)] #[serde(rename_all = "snake_case")] enum ReadMode { - #[default] Slice, Indentation, } @@ -462,6 +461,12 @@ mod defaults { } } + impl Default for ReadMode { + fn default() -> Self { + Self::Slice + } + } + pub fn offset() -> usize { 1 } diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index f40bedda2564..6850c2ac1159 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -1656,16 +1656,21 @@ pub struct ReviewLineRange { pub end: u32, } -#[derive(Debug, Clone, Copy, Display, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS, Default)] +#[derive(Debug, Clone, Copy, Display, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)] #[serde(rename_all = "snake_case")] pub enum ExecCommandSource { - #[default] Agent, UserShell, UnifiedExecStartup, UnifiedExecInteraction, } +impl Default for ExecCommandSource { + fn default() -> Self { + Self::Agent + } +} + #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] pub struct ExecCommandBeginEvent { /// Identifier so this can be paired with the ExecCommandEnd event. From 6e09e26bab7d10b9efdd3d96fd6b2d8016d3840d Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Thu, 15 Jan 2026 23:11:19 -0800 Subject: [PATCH 06/16] Downgrade Rust toolchain to 1.91 --- .github/workflows/rust-ci.yml | 8 ++++---- .github/workflows/rust-release.yml | 2 +- .github/workflows/sdk.yml | 2 +- .github/workflows/shell-tool-mcp.yml | 2 +- codex-rs/rust-toolchain.toml | 2 +- codex-rs/scripts/setup-windows.ps1 | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 22a1a8320ee2..1b715a9e1e6d 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -59,7 +59,7 @@ jobs: working-directory: codex-rs steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.92 + - uses: dtolnay/rust-toolchain@1.91 with: components: rustfmt - name: cargo fmt @@ -77,7 +77,7 @@ jobs: working-directory: codex-rs steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.92 + - uses: dtolnay/rust-toolchain@1.91 - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: cargo-shear @@ -177,7 +177,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.92 + - uses: dtolnay/rust-toolchain@1.91 with: targets: ${{ matrix.target }} components: clippy @@ -416,7 +416,7 @@ jobs: - name: Install DotSlash uses: facebook/install-dotslash@v2 - - uses: dtolnay/rust-toolchain@1.92 + - uses: dtolnay/rust-toolchain@1.91 with: targets: ${{ matrix.target }} diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index acc8b6bafe94..15c21285ca03 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -80,7 +80,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.92 + - uses: dtolnay/rust-toolchain@1.91 with: targets: ${{ matrix.target }} diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index f506dce6ba1b..cc60cec7d6f1 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -24,7 +24,7 @@ jobs: node-version: 22 cache: pnpm - - uses: dtolnay/rust-toolchain@1.92 + - uses: dtolnay/rust-toolchain@1.91 - name: build codex run: cargo build --bin codex diff --git a/.github/workflows/shell-tool-mcp.yml b/.github/workflows/shell-tool-mcp.yml index bc49a90fa6a6..c48fbe639e8f 100644 --- a/.github/workflows/shell-tool-mcp.yml +++ b/.github/workflows/shell-tool-mcp.yml @@ -93,7 +93,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.92 + - uses: dtolnay/rust-toolchain@1.91 with: targets: ${{ matrix.target }} diff --git a/codex-rs/rust-toolchain.toml b/codex-rs/rust-toolchain.toml index 05eeaac960ae..39227a11b5a1 100644 --- a/codex-rs/rust-toolchain.toml +++ b/codex-rs/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.92.0" +channel = "1.91.0" components = ["clippy", "rustfmt", "rust-src"] diff --git a/codex-rs/scripts/setup-windows.ps1 b/codex-rs/scripts/setup-windows.ps1 index 33b6b0c35226..3f623ad8c279 100644 --- a/codex-rs/scripts/setup-windows.ps1 +++ b/codex-rs/scripts/setup-windows.ps1 @@ -179,7 +179,7 @@ if (-not (Ensure-Command 'cargo')) { Write-Host "==> Configuring Rust toolchain per rust-toolchain.toml" -ForegroundColor Cyan # Pin to the workspace toolchain and install components -$toolchain = '1.92.0' +$toolchain = '1.91.0' & rustup toolchain install $toolchain --profile minimal | Out-Host & rustup default $toolchain | Out-Host & rustup component add clippy rustfmt rust-src --toolchain $toolchain | Out-Host From 7b0e6b4f8d9664bb1f008d3fd5a2c41e61b3578f Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Thu, 15 Jan 2026 23:25:42 -0800 Subject: [PATCH 07/16] Restore Rust 1.92 and fix clippy defaults --- .github/workflows/rust-ci.yml | 8 ++++---- .github/workflows/rust-release.yml | 2 +- .github/workflows/sdk.yml | 2 +- .github/workflows/shell-tool-mcp.yml | 2 +- .../src/models/rate_limit_status_payload.rs | 11 ++++------- codex-rs/protocol/src/protocol.rs | 11 ++++------- codex-rs/rust-toolchain.toml | 2 +- codex-rs/scripts/setup-windows.ps1 | 2 +- 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 1b715a9e1e6d..22a1a8320ee2 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -59,7 +59,7 @@ jobs: working-directory: codex-rs steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.91 + - uses: dtolnay/rust-toolchain@1.92 with: components: rustfmt - name: cargo fmt @@ -77,7 +77,7 @@ jobs: working-directory: codex-rs steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.91 + - uses: dtolnay/rust-toolchain@1.92 - uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2 with: tool: cargo-shear @@ -177,7 +177,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.91 + - uses: dtolnay/rust-toolchain@1.92 with: targets: ${{ matrix.target }} components: clippy @@ -416,7 +416,7 @@ jobs: - name: Install DotSlash uses: facebook/install-dotslash@v2 - - uses: dtolnay/rust-toolchain@1.91 + - uses: dtolnay/rust-toolchain@1.92 with: targets: ${{ matrix.target }} diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 15c21285ca03..acc8b6bafe94 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -80,7 +80,7 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.91 + - uses: dtolnay/rust-toolchain@1.92 with: targets: ${{ matrix.target }} diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index cc60cec7d6f1..f506dce6ba1b 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -24,7 +24,7 @@ jobs: node-version: 22 cache: pnpm - - uses: dtolnay/rust-toolchain@1.91 + - uses: dtolnay/rust-toolchain@1.92 - name: build codex run: cargo build --bin codex diff --git a/.github/workflows/shell-tool-mcp.yml b/.github/workflows/shell-tool-mcp.yml index c48fbe639e8f..bc49a90fa6a6 100644 --- a/.github/workflows/shell-tool-mcp.yml +++ b/.github/workflows/shell-tool-mcp.yml @@ -93,7 +93,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 - - uses: dtolnay/rust-toolchain@1.91 + - uses: dtolnay/rust-toolchain@1.92 with: targets: ${{ matrix.target }} diff --git a/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs b/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs index 0f5caf52ff52..daf8e6af39a7 100644 --- a/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs +++ b/codex-rs/codex-backend-openapi-models/src/models/rate_limit_status_payload.rs @@ -42,9 +42,12 @@ impl RateLimitStatusPayload { } } -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +#[derive( + Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default, +)] pub enum PlanType { #[serde(rename = "guest")] + #[default] Guest, #[serde(rename = "free")] Free, @@ -71,9 +74,3 @@ pub enum PlanType { #[serde(rename = "edu")] Edu, } - -impl Default for PlanType { - fn default() -> PlanType { - Self::Guest - } -} diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index 6850c2ac1159..1a7d38dd23df 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -1656,21 +1656,18 @@ pub struct ReviewLineRange { pub end: u32, } -#[derive(Debug, Clone, Copy, Display, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)] +#[derive( + Debug, Clone, Copy, Display, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS, Default, +)] #[serde(rename_all = "snake_case")] pub enum ExecCommandSource { + #[default] Agent, UserShell, UnifiedExecStartup, UnifiedExecInteraction, } -impl Default for ExecCommandSource { - fn default() -> Self { - Self::Agent - } -} - #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)] pub struct ExecCommandBeginEvent { /// Identifier so this can be paired with the ExecCommandEnd event. diff --git a/codex-rs/rust-toolchain.toml b/codex-rs/rust-toolchain.toml index 39227a11b5a1..05eeaac960ae 100644 --- a/codex-rs/rust-toolchain.toml +++ b/codex-rs/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.91.0" +channel = "1.92.0" components = ["clippy", "rustfmt", "rust-src"] diff --git a/codex-rs/scripts/setup-windows.ps1 b/codex-rs/scripts/setup-windows.ps1 index 3f623ad8c279..33b6b0c35226 100644 --- a/codex-rs/scripts/setup-windows.ps1 +++ b/codex-rs/scripts/setup-windows.ps1 @@ -179,7 +179,7 @@ if (-not (Ensure-Command 'cargo')) { Write-Host "==> Configuring Rust toolchain per rust-toolchain.toml" -ForegroundColor Cyan # Pin to the workspace toolchain and install components -$toolchain = '1.91.0' +$toolchain = '1.92.0' & rustup toolchain install $toolchain --profile minimal | Out-Host & rustup default $toolchain | Out-Host & rustup component add clippy rustfmt rust-src --toolchain $toolchain | Out-Host From 311aa08e2c6a5c12867432a0a0bb9c6bf62014e5 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 09:05:12 -0800 Subject: [PATCH 08/16] Fix clippy defaults and originator tests --- codex-rs/app-server/tests/suite/user_agent.rs | 6 +++++- codex-rs/app-server/tests/suite/v2/initialize.rs | 6 +++++- codex-rs/app-server/tests/suite/v2/turn_start.rs | 6 +++++- codex-rs/core/src/config/types.rs | 9 ++------- codex-rs/core/src/shell.rs | 13 +++++++------ codex-rs/core/src/tools/handlers/read_file.rs | 9 ++------- codex-rs/core/tests/suite/client.rs | 5 +++-- codex-rs/mcp-server/tests/common/mcp_process.rs | 2 +- 8 files changed, 30 insertions(+), 26 deletions(-) diff --git a/codex-rs/app-server/tests/suite/user_agent.rs b/codex-rs/app-server/tests/suite/user_agent.rs index 9178a3ef5841..9e07a9c7dc06 100644 --- a/codex-rs/app-server/tests/suite/user_agent.rs +++ b/codex-rs/app-server/tests/suite/user_agent.rs @@ -15,7 +15,11 @@ const DEFAULT_READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs async fn get_user_agent_returns_current_codex_user_agent() -> Result<()> { let codex_home = TempDir::new()?; - let mut mcp = McpProcess::new(codex_home.path()).await?; + let mut mcp = McpProcess::new_with_env( + codex_home.path(), + &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], + ) + .await?; timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??; let request_id = mcp.send_get_user_agent_request().await?; diff --git a/codex-rs/app-server/tests/suite/v2/initialize.rs b/codex-rs/app-server/tests/suite/v2/initialize.rs index b31a68833f36..2568f0718214 100644 --- a/codex-rs/app-server/tests/suite/v2/initialize.rs +++ b/codex-rs/app-server/tests/suite/v2/initialize.rs @@ -18,7 +18,11 @@ async fn initialize_uses_client_info_name_as_originator() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new(codex_home.path()).await?; + let mut mcp = McpProcess::new_with_env( + codex_home.path(), + &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], + ) + .await?; let message = timeout( DEFAULT_READ_TIMEOUT, diff --git a/codex-rs/app-server/tests/suite/v2/turn_start.rs b/codex-rs/app-server/tests/suite/v2/turn_start.rs index 406f80328ba0..98950a9ab3fe 100644 --- a/codex-rs/app-server/tests/suite/v2/turn_start.rs +++ b/codex-rs/app-server/tests/suite/v2/turn_start.rs @@ -51,7 +51,11 @@ async fn turn_start_sends_originator_header() -> Result<()> { let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new(codex_home.path()).await?; + let mut mcp = McpProcess::new_with_env( + codex_home.path(), + &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], + ) + .await?; timeout( DEFAULT_READ_TIMEOUT, mcp.initialize_with_client_info(ClientInfo { diff --git a/codex-rs/core/src/config/types.rs b/codex-rs/core/src/config/types.rs index 981f9b541aa8..9d75302cbd08 100644 --- a/codex-rs/core/src/config/types.rs +++ b/codex-rs/core/src/config/types.rs @@ -423,10 +423,11 @@ impl Default for Notifications { /// Terminals generally encode both mouse wheels and trackpads as the same "scroll up/down" mouse /// button events, without a magnitude. This setting controls whether Codex uses a heuristic to /// infer wheel vs trackpad per stream, or forces a specific behavior. -#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema)] +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, Default)] #[serde(rename_all = "snake_case")] pub enum ScrollInputMode { /// Infer wheel vs trackpad behavior per scroll stream. + #[default] Auto, /// Always treat scroll events as mouse-wheel input (fixed lines per tick). Wheel, @@ -434,12 +435,6 @@ pub enum ScrollInputMode { Trackpad, } -impl Default for ScrollInputMode { - fn default() -> Self { - Self::Auto - } -} - /// Collection of settings that are specific to the TUI. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema)] #[schemars(deny_unknown_fields)] diff --git a/codex-rs/core/src/shell.rs b/codex-rs/core/src/shell.rs index d22b6543a9f5..b6adf861d863 100644 --- a/codex-rs/core/src/shell.rs +++ b/codex-rs/core/src/shell.rs @@ -340,6 +340,7 @@ mod detect_shell_type_tests { #[cfg(unix)] mod tests { use super::*; + use std::path::Path; use std::path::PathBuf; use std::process::Command; @@ -350,7 +351,7 @@ mod tests { let shell_path = zsh_shell.shell_path; - assert_eq!(shell_path, PathBuf::from("/bin/zsh")); + assert_eq!(shell_path, Path::new("/bin/zsh")); } #[test] @@ -360,7 +361,7 @@ mod tests { let shell_path = zsh_shell.shell_path; - assert_eq!(shell_path, PathBuf::from("/bin/zsh")); + assert_eq!(shell_path, Path::new("/bin/zsh")); } #[test] @@ -369,9 +370,9 @@ mod tests { let shell_path = bash_shell.shell_path; assert!( - shell_path == PathBuf::from("/bin/bash") - || shell_path == PathBuf::from("/usr/bin/bash") - || shell_path == PathBuf::from("/usr/local/bin/bash"), + shell_path == Path::new("/bin/bash") + || shell_path == Path::new("/usr/bin/bash") + || shell_path == Path::new("/usr/local/bin/bash"), "shell path: {shell_path:?}", ); } @@ -381,7 +382,7 @@ mod tests { let sh_shell = get_shell(ShellType::Sh, None).unwrap(); let shell_path = sh_shell.shell_path; assert!( - shell_path == PathBuf::from("/bin/sh") || shell_path == PathBuf::from("/usr/bin/sh"), + shell_path == Path::new("/bin/sh") || shell_path == Path::new("/usr/bin/sh"), "shell path: {shell_path:?}", ); } diff --git a/codex-rs/core/src/tools/handlers/read_file.rs b/codex-rs/core/src/tools/handlers/read_file.rs index 4f187540a6e1..eb5ce647ce34 100644 --- a/codex-rs/core/src/tools/handlers/read_file.rs +++ b/codex-rs/core/src/tools/handlers/read_file.rs @@ -40,9 +40,10 @@ struct ReadFileArgs { indentation: Option, } -#[derive(Deserialize)] +#[derive(Deserialize, Default)] #[serde(rename_all = "snake_case")] enum ReadMode { + #[default] Slice, Indentation, } @@ -461,12 +462,6 @@ mod defaults { } } - impl Default for ReadMode { - fn default() -> Self { - Self::Slice - } - } - pub fn offset() -> usize { 1 } diff --git a/codex-rs/core/tests/suite/client.rs b/codex-rs/core/tests/suite/client.rs index 18d3caf3bfcb..6f659e1b6497 100644 --- a/codex-rs/core/tests/suite/client.rs +++ b/codex-rs/core/tests/suite/client.rs @@ -14,6 +14,7 @@ use codex_core::ThreadManager; use codex_core::WireApi; use codex_core::auth::AuthCredentialsStoreMode; use codex_core::built_in_model_providers; +use codex_core::default_client::originator; use codex_core::error::CodexErr; use codex_core::models_manager::manager::ModelsManager; use codex_core::protocol::EventMsg; @@ -406,7 +407,7 @@ async fn includes_conversation_id_and_model_headers_in_request() { let request_originator = request.header("originator").expect("originator header"); assert_eq!(request_session_id, session_id.to_string()); - assert_eq!(request_originator, "codex_cli_rs"); + assert_eq!(request_originator, originator().value); assert_eq!(request_authorization, "Bearer Test API Key"); } @@ -522,7 +523,7 @@ async fn chatgpt_auth_sends_correct_request() { let session_id = request.header("session_id").expect("session_id header"); assert_eq!(session_id, thread_id.to_string()); - assert_eq!(request_originator, "codex_cli_rs"); + assert_eq!(request_originator, originator().value); assert_eq!(request_authorization, "Bearer Access Token"); assert_eq!(request_chatgpt_account_id, "account_id"); assert!(request_body["stream"].as_bool().unwrap()); diff --git a/codex-rs/mcp-server/tests/common/mcp_process.rs b/codex-rs/mcp-server/tests/common/mcp_process.rs index 7e447533d0f1..1a7702ce4a0e 100644 --- a/codex-rs/mcp-server/tests/common/mcp_process.rs +++ b/codex-rs/mcp-server/tests/common/mcp_process.rs @@ -41,7 +41,7 @@ pub struct McpProcess { impl McpProcess { pub async fn new(codex_home: &Path) -> anyhow::Result { - Self::new_with_env(codex_home, &[]).await + Self::new_with_env(codex_home, &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)]).await } /// Creates a new MCP process, allowing tests to override or remove From 2f46b98d37bd3a9d203642048580f20450ccb097 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 09:26:27 -0800 Subject: [PATCH 09/16] Fix unused assignment in TUI renderable --- codex-rs/tui/src/render/renderable.rs | 1 - codex-rs/tui2/src/render/renderable.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/codex-rs/tui/src/render/renderable.rs b/codex-rs/tui/src/render/renderable.rs index 8581468c0a83..eb514b3b0f70 100644 --- a/codex-rs/tui/src/render/renderable.rs +++ b/codex-rs/tui/src/render/renderable.rs @@ -275,7 +275,6 @@ impl<'a> FlexRenderable<'a> { }; let child_size = child.desired_height(area.width).min(max_child_extent); child_sizes[i] = child_size; - allocated_size += child_size; allocated_flex_space += child_size; } } diff --git a/codex-rs/tui2/src/render/renderable.rs b/codex-rs/tui2/src/render/renderable.rs index 8581468c0a83..eb514b3b0f70 100644 --- a/codex-rs/tui2/src/render/renderable.rs +++ b/codex-rs/tui2/src/render/renderable.rs @@ -275,7 +275,6 @@ impl<'a> FlexRenderable<'a> { }; let child_size = child.desired_height(area.width).min(max_child_extent); child_sizes[i] = child_size; - allocated_size += child_size; allocated_flex_space += child_size; } } From 3130156dd6429f876b122ceb7e26dd36b8fedd20 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 09:46:53 -0800 Subject: [PATCH 10/16] Derive Default for windows sandbox setup mode --- codex-rs/windows-sandbox-rs/src/setup_main_win.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/codex-rs/windows-sandbox-rs/src/setup_main_win.rs b/codex-rs/windows-sandbox-rs/src/setup_main_win.rs index e1b914859e6f..52e60a1da70d 100644 --- a/codex-rs/windows-sandbox-rs/src/setup_main_win.rs +++ b/codex-rs/windows-sandbox-rs/src/setup_main_win.rs @@ -76,19 +76,14 @@ struct Payload { refresh_only: bool, } -#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, Default)] #[serde(rename_all = "kebab-case")] enum SetupMode { + #[default] Full, ReadAclsOnly, } -impl Default for SetupMode { - fn default() -> Self { - Self::Full - } -} - fn log_line(log: &mut File, msg: &str) -> Result<()> { let ts = chrono::Utc::now().to_rfc3339(); writeln!(log, "[{ts}] {msg}")?; From 521bada5ba28f1a4e8f6be0d76ac4201570d7066 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 10:22:07 -0800 Subject: [PATCH 11/16] Revert originator env removal in mcp tests --- codex-rs/mcp-server/tests/common/mcp_process.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/mcp-server/tests/common/mcp_process.rs b/codex-rs/mcp-server/tests/common/mcp_process.rs index 1a7702ce4a0e..7e447533d0f1 100644 --- a/codex-rs/mcp-server/tests/common/mcp_process.rs +++ b/codex-rs/mcp-server/tests/common/mcp_process.rs @@ -41,7 +41,7 @@ pub struct McpProcess { impl McpProcess { pub async fn new(codex_home: &Path) -> anyhow::Result { - Self::new_with_env(codex_home, &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)]).await + Self::new_with_env(codex_home, &[]).await } /// Creates a new MCP process, allowing tests to override or remove From b82537c9253f0e4391fe4596d5b113dd59805dfe Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 10:28:38 -0800 Subject: [PATCH 12/16] Remove originator env stripping in app server tests --- codex-rs/app-server/tests/suite/user_agent.rs | 6 +----- codex-rs/app-server/tests/suite/v2/initialize.rs | 12 ++---------- codex-rs/app-server/tests/suite/v2/turn_start.rs | 6 +----- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/codex-rs/app-server/tests/suite/user_agent.rs b/codex-rs/app-server/tests/suite/user_agent.rs index 9e07a9c7dc06..9178a3ef5841 100644 --- a/codex-rs/app-server/tests/suite/user_agent.rs +++ b/codex-rs/app-server/tests/suite/user_agent.rs @@ -15,11 +15,7 @@ const DEFAULT_READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs async fn get_user_agent_returns_current_codex_user_agent() -> Result<()> { let codex_home = TempDir::new()?; - let mut mcp = McpProcess::new_with_env( - codex_home.path(), - &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], - ) - .await?; + let mut mcp = McpProcess::new(codex_home.path()).await?; timeout(DEFAULT_READ_TIMEOUT, mcp.initialize()).await??; let request_id = mcp.send_get_user_agent_request().await?; diff --git a/codex-rs/app-server/tests/suite/v2/initialize.rs b/codex-rs/app-server/tests/suite/v2/initialize.rs index 2568f0718214..d2244f3fb90a 100644 --- a/codex-rs/app-server/tests/suite/v2/initialize.rs +++ b/codex-rs/app-server/tests/suite/v2/initialize.rs @@ -18,11 +18,7 @@ async fn initialize_uses_client_info_name_as_originator() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new_with_env( - codex_home.path(), - &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], - ) - .await?; + let mut mcp = McpProcess::new(codex_home.path()).await?; let message = timeout( DEFAULT_READ_TIMEOUT, @@ -83,11 +79,7 @@ async fn initialize_rejects_invalid_client_name() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new_with_env( - codex_home.path(), - &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], - ) - .await?; + let mut mcp = McpProcess::new(codex_home.path()).await?; let message = timeout( DEFAULT_READ_TIMEOUT, diff --git a/codex-rs/app-server/tests/suite/v2/turn_start.rs b/codex-rs/app-server/tests/suite/v2/turn_start.rs index 98950a9ab3fe..406f80328ba0 100644 --- a/codex-rs/app-server/tests/suite/v2/turn_start.rs +++ b/codex-rs/app-server/tests/suite/v2/turn_start.rs @@ -51,11 +51,7 @@ async fn turn_start_sends_originator_header() -> Result<()> { let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new_with_env( - codex_home.path(), - &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], - ) - .await?; + let mut mcp = McpProcess::new(codex_home.path()).await?; timeout( DEFAULT_READ_TIMEOUT, mcp.initialize_with_client_info(ClientInfo { From 0f1541622d124ded9b1053f588f4c80c37b5bfdb Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 10:40:50 -0800 Subject: [PATCH 13/16] Restore originator expectations in core/app tests --- codex-rs/app-server/tests/suite/v2/initialize.rs | 12 ++++++++++-- codex-rs/core/tests/suite/client.rs | 5 ++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/codex-rs/app-server/tests/suite/v2/initialize.rs b/codex-rs/app-server/tests/suite/v2/initialize.rs index d2244f3fb90a..2568f0718214 100644 --- a/codex-rs/app-server/tests/suite/v2/initialize.rs +++ b/codex-rs/app-server/tests/suite/v2/initialize.rs @@ -18,7 +18,11 @@ async fn initialize_uses_client_info_name_as_originator() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new(codex_home.path()).await?; + let mut mcp = McpProcess::new_with_env( + codex_home.path(), + &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], + ) + .await?; let message = timeout( DEFAULT_READ_TIMEOUT, @@ -79,7 +83,11 @@ async fn initialize_rejects_invalid_client_name() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new(codex_home.path()).await?; + let mut mcp = McpProcess::new_with_env( + codex_home.path(), + &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], + ) + .await?; let message = timeout( DEFAULT_READ_TIMEOUT, diff --git a/codex-rs/core/tests/suite/client.rs b/codex-rs/core/tests/suite/client.rs index 6f659e1b6497..18d3caf3bfcb 100644 --- a/codex-rs/core/tests/suite/client.rs +++ b/codex-rs/core/tests/suite/client.rs @@ -14,7 +14,6 @@ use codex_core::ThreadManager; use codex_core::WireApi; use codex_core::auth::AuthCredentialsStoreMode; use codex_core::built_in_model_providers; -use codex_core::default_client::originator; use codex_core::error::CodexErr; use codex_core::models_manager::manager::ModelsManager; use codex_core::protocol::EventMsg; @@ -407,7 +406,7 @@ async fn includes_conversation_id_and_model_headers_in_request() { let request_originator = request.header("originator").expect("originator header"); assert_eq!(request_session_id, session_id.to_string()); - assert_eq!(request_originator, originator().value); + assert_eq!(request_originator, "codex_cli_rs"); assert_eq!(request_authorization, "Bearer Test API Key"); } @@ -523,7 +522,7 @@ async fn chatgpt_auth_sends_correct_request() { let session_id = request.header("session_id").expect("session_id header"); assert_eq!(session_id, thread_id.to_string()); - assert_eq!(request_originator, originator().value); + assert_eq!(request_originator, "codex_cli_rs"); assert_eq!(request_authorization, "Bearer Access Token"); assert_eq!(request_chatgpt_account_id, "account_id"); assert!(request_body["stream"].as_bool().unwrap()); From f57613b77b6839efb0b7bc4dfcf51c4fac3607f1 Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 10:44:28 -0800 Subject: [PATCH 14/16] Restore initialize test setup --- codex-rs/app-server/tests/suite/v2/initialize.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/codex-rs/app-server/tests/suite/v2/initialize.rs b/codex-rs/app-server/tests/suite/v2/initialize.rs index 2568f0718214..d2244f3fb90a 100644 --- a/codex-rs/app-server/tests/suite/v2/initialize.rs +++ b/codex-rs/app-server/tests/suite/v2/initialize.rs @@ -18,11 +18,7 @@ async fn initialize_uses_client_info_name_as_originator() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new_with_env( - codex_home.path(), - &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], - ) - .await?; + let mut mcp = McpProcess::new(codex_home.path()).await?; let message = timeout( DEFAULT_READ_TIMEOUT, @@ -83,11 +79,7 @@ async fn initialize_rejects_invalid_client_name() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new_with_env( - codex_home.path(), - &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], - ) - .await?; + let mut mcp = McpProcess::new(codex_home.path()).await?; let message = timeout( DEFAULT_READ_TIMEOUT, From 78dc124fef35bb0a8bc5e0d5ad6575a28d80d5aa Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 10:50:42 -0800 Subject: [PATCH 15/16] Restore env stripping for invalid client name test --- codex-rs/app-server/tests/suite/v2/initialize.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codex-rs/app-server/tests/suite/v2/initialize.rs b/codex-rs/app-server/tests/suite/v2/initialize.rs index d2244f3fb90a..356aa8b97431 100644 --- a/codex-rs/app-server/tests/suite/v2/initialize.rs +++ b/codex-rs/app-server/tests/suite/v2/initialize.rs @@ -18,7 +18,11 @@ async fn initialize_uses_client_info_name_as_originator() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new(codex_home.path()).await?; + let mut mcp = McpProcess::new_with_env( + codex_home.path(), + &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], + ) + .await?; let message = timeout( DEFAULT_READ_TIMEOUT, From 77d33a6e8f5e31db98d65bfcc20a34179f5adf2f Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Fri, 16 Jan 2026 11:01:40 -0800 Subject: [PATCH 16/16] revert initialize.rs changes --- codex-rs/app-server/tests/suite/v2/initialize.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/codex-rs/app-server/tests/suite/v2/initialize.rs b/codex-rs/app-server/tests/suite/v2/initialize.rs index 356aa8b97431..b31a68833f36 100644 --- a/codex-rs/app-server/tests/suite/v2/initialize.rs +++ b/codex-rs/app-server/tests/suite/v2/initialize.rs @@ -18,11 +18,7 @@ async fn initialize_uses_client_info_name_as_originator() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new_with_env( - codex_home.path(), - &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], - ) - .await?; + let mut mcp = McpProcess::new(codex_home.path()).await?; let message = timeout( DEFAULT_READ_TIMEOUT, @@ -83,7 +79,11 @@ async fn initialize_rejects_invalid_client_name() -> Result<()> { let server = create_mock_responses_server_sequence_unchecked(responses).await; let codex_home = TempDir::new()?; create_config_toml(codex_home.path(), &server.uri(), "never")?; - let mut mcp = McpProcess::new(codex_home.path()).await?; + let mut mcp = McpProcess::new_with_env( + codex_home.path(), + &[("CODEX_INTERNAL_ORIGINATOR_OVERRIDE", None)], + ) + .await?; let message = timeout( DEFAULT_READ_TIMEOUT,