diff --git a/.codex-pr-threads.json b/.codex-pr-threads.json new file mode 100644 index 000000000..f32b5954e --- /dev/null +++ b/.codex-pr-threads.json @@ -0,0 +1,36 @@ +{ + "20": { + "merge": "019a5fbc-ac25-76d0-be65-60c9c4a0c590" + }, + "21": { + "merge": "019a5fb3-b1c4-71b3-acca-42b62a1ffc61", + "merge_pr": "019a5fb4-4f9e-7152-b071-8a1002f19399" + }, + "23": { + "merge": "019a5fad-8db7-7561-9ae2-ce920763739e", + "merge_pr": "019a5fae-2366-75b0-9470-3432932bdd74" + }, + "24": { + "merge": "019a5f84-b67a-7f51-a009-692c011fbdb5", + "fix": "019a5f85-574d-7173-b56b-814ae0135898" + }, + "25": { + "merge": "019a5f6c-ce5a-76e0-abfc-fe21ad5cd8ef", + "fix": "019a5f6d-5a9e-7ad3-8e19-63ae4d006325" + }, + "26": { + "merge": "019a5dcc-5a04-7392-918e-651c8a3cc4b8", + "fix": "019a5f6c-bede-7902-829c-78184605e615" + }, + "27": { + "merge": "019a5dcc-5287-7970-b7e4-22df4ffd7ad1", + "fix": "019a5f6c-a75d-7cb3-a198-e9b9f844f51f" + }, + "28": { + "merge": "019a5dcb-d5e3-7940-b251-3671d2177fe5" + }, + "29": { + "build": "019a5dcb-b8bf-7cc3-8568-915408db3b33", + "merge": "019a5dcd-a57e-75d0-9b76-5ce74362b8dc" + } +} diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index b625643bd..aa9f45c77 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -61,7 +61,7 @@ jobs: working-directory: codex-rs steps: - uses: actions/checkout@v5 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.91 with: components: rustfmt - name: cargo fmt @@ -79,7 +79,7 @@ jobs: working-directory: codex-rs steps: - uses: actions/checkout@v5 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.91 - uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2 with: tool: cargo-shear @@ -152,7 +152,7 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.91 with: targets: ${{ matrix.target }} components: clippy @@ -356,7 +356,7 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: dtolnay/rust-toolchain@1.90 + - uses: dtolnay/rust-toolchain@1.91 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 d2af76f4d..39c3d4df6 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 @@ -34,9 +34,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 = "free")] + #[default] Free, #[serde(rename = "go")] Go, @@ -57,9 +60,3 @@ pub enum PlanType { #[serde(rename = "edu")] Edu, } - -impl Default for PlanType { - fn default() -> PlanType { - Self::Free - } -} diff --git a/codex-rs/core/src/default_client.rs b/codex-rs/core/src/default_client.rs index 8e4635460..6cf2da764 100644 --- a/codex-rs/core/src/default_client.rs +++ b/codex-rs/core/src/default_client.rs @@ -260,19 +260,34 @@ fn sanitize_user_agent(candidate: String, fallback: &str) -> String { pub fn create_client() -> CodexHttpClient { use reqwest::header::HeaderMap; - let mut headers = HeaderMap::new(); - headers.insert("originator", originator().header_value.clone()); + let mut default_headers = HeaderMap::new(); + default_headers.insert("originator", originator().header_value.clone()); let ua = get_codex_user_agent(); - let mut builder = reqwest::Client::builder() - // Set UA via dedicated helper to avoid header validation pitfalls - .user_agent(ua) - .default_headers(headers); - if is_sandboxed() { - builder = builder.no_proxy(); - } - - let inner = builder.build().unwrap_or_else(|_| reqwest::Client::new()); + let build_client = || { + let mut builder = reqwest::Client::builder() + .use_rustls_tls() + // Set UA via dedicated helper to avoid header validation pitfalls + .user_agent(ua.clone()) + .default_headers(default_headers.clone()); + if is_sandboxed() { + builder = builder.no_proxy(); + } + builder.build() + }; + + let inner = match build_client() { + Ok(client) => client, + Err(error) => { + tracing::error!(?error, "Failed to build reqwest client with rustls"); + match build_client() { + Ok(client) => client, + Err(error) => { + panic!("failed to build reqwest client with rustls: {error}"); + } + } + } + }; CodexHttpClient::new(inner) } diff --git a/codex-rs/core/src/tools/handlers/read_file.rs b/codex-rs/core/src/tools/handlers/read_file.rs index 58b6ea688..98174db53 100644 --- a/codex-rs/core/src/tools/handlers/read_file.rs +++ b/codex-rs/core/src/tools/handlers/read_file.rs @@ -41,7 +41,9 @@ struct ReadFileArgs { #[derive(Deserialize)] #[serde(rename_all = "snake_case")] +#[derive(Default)] enum ReadMode { + #[default] Slice, Indentation, } @@ -464,12 +466,6 @@ mod defaults { } } - impl Default for ReadMode { - fn default() -> Self { - Self::Slice - } - } - pub fn offset() -> usize { 1 } diff --git a/codex-rs/rust-toolchain.toml b/codex-rs/rust-toolchain.toml index 7187a3318..39227a11b 100644 --- a/codex-rs/rust-toolchain.toml +++ b/codex-rs/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.90.0" +channel = "1.91.0" components = ["clippy", "rustfmt", "rust-src"] diff --git a/codex-rs/tui/src/slash_command.rs b/codex-rs/tui/src/slash_command.rs index 969d279b0..0c54fcf87 100644 --- a/codex-rs/tui/src/slash_command.rs +++ b/codex-rs/tui/src/slash_command.rs @@ -84,10 +84,7 @@ impl SlashCommand { } fn is_visible(self) -> bool { - match self { - SlashCommand::Rollout | SlashCommand::TestApproval => cfg!(debug_assertions), - _ => true, - } + !matches!(self, SlashCommand::Rollout | SlashCommand::TestApproval) || cfg!(debug_assertions) } }