Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .codex-pr-threads.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
8 changes: 4 additions & 4 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -57,9 +60,3 @@ pub enum PlanType {
#[serde(rename = "edu")]
Edu,
}

impl Default for PlanType {
fn default() -> PlanType {
Self::Free
}
}
37 changes: 26 additions & 11 deletions codex-rs/core/src/default_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
8 changes: 2 additions & 6 deletions codex-rs/core/src/tools/handlers/read_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ struct ReadFileArgs {

#[derive(Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Default)]
enum ReadMode {
#[default]
Slice,
Indentation,
}
Expand Down Expand Up @@ -464,12 +466,6 @@ mod defaults {
}
}

impl Default for ReadMode {
fn default() -> Self {
Self::Slice
}
}

pub fn offset() -> usize {
1
}
Expand Down
2 changes: 1 addition & 1 deletion codex-rs/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.90.0"
channel = "1.91.0"
components = ["clippy", "rustfmt", "rust-src"]
5 changes: 1 addition & 4 deletions codex-rs/tui/src/slash_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down