Skip to content

Commit d920508

Browse files
Merge remote-tracking branch 'origin/main' into renovate/libc-0.x-lockfile
2 parents f74a8bf + 87f431c commit d920508

19 files changed

Lines changed: 3063 additions & 128 deletions

File tree

‎.github/workflows/codespell.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ jobs:
2626
- name: Annotate locations with typos
2727
uses: codespell-project/codespell-problem-matcher@b80729f885d32f78a716c2f107b4db1025001c42 # v1
2828
- name: Codespell
29-
uses: codespell-project/actions-codespell@406322ec52dd7b488e48c1c4b82e2a8b3a1bf630 # v2.1
29+
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 # v2.2
3030
with:
3131
ignore_words_file: .codespellignore

‎codex-rs/Cargo.lock‎

Lines changed: 17 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎codex-rs/backend-client/src/client.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl Client {
5858
{
5959
base_url = format!("{base_url}/backend-api");
6060
}
61-
let http = reqwest::Client::builder().build()?;
61+
let http = reqwest::Client::builder().use_rustls_tls().build()?;
6262
let path_style = PathStyle::from_base_url(&base_url);
6363
Ok(Self {
6464
base_url,

‎codex-rs/cloud-tasks/src/env_detect.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub async fn autodetect_environment_id(
7373
};
7474
crate::append_error_log(format!("env: GET {list_url}"));
7575
// Fetch and log the full environments JSON for debugging
76-
let http = reqwest::Client::builder().build()?;
76+
let http = reqwest::Client::builder().use_rustls_tls().build()?;
7777
let res = http.get(&list_url).headers(headers.clone()).send().await?;
7878
let status = res.status();
7979
let ct = res
@@ -147,7 +147,7 @@ async fn get_json<T: serde::de::DeserializeOwned>(
147147
url: &str,
148148
headers: &HeaderMap,
149149
) -> anyhow::Result<T> {
150-
let http = reqwest::Client::builder().build()?;
150+
let http = reqwest::Client::builder().use_rustls_tls().build()?;
151151
let res = http.get(url).headers(headers.clone()).send().await?;
152152
let status = res.status();
153153
let ct = res

‎codex-rs/login/src/device_code_auth.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ fn print_colored_warning_device_code() {
150150

151151
/// Full device code login flow.
152152
pub async fn run_device_code_login(opts: ServerOptions) -> std::io::Result<()> {
153-
let client = reqwest::Client::new();
153+
let client = reqwest::Client::builder()
154+
.use_rustls_tls()
155+
.build()
156+
.map_err(|err| std::io::Error::other(format!("failed to build HTTP client: {err}")))?;
154157
let base_url = opts.issuer.trim_end_matches('/');
155158
let api_base_url = format!("{}/api/accounts", opts.issuer.trim_end_matches('/'));
156159
print_colored_warning_device_code();

‎codex-rs/login/src/server.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,10 @@ pub(crate) async fn exchange_code_for_tokens(
505505
refresh_token: String,
506506
}
507507

508-
let client = reqwest::Client::new();
508+
let client = reqwest::Client::builder()
509+
.use_rustls_tls()
510+
.build()
511+
.map_err(io::Error::other)?;
509512
let resp = client
510513
.post(format!("{issuer}/oauth/token"))
511514
.header("Content-Type", "application/x-www-form-urlencoded")
@@ -695,7 +698,10 @@ pub(crate) async fn obtain_api_key(
695698
struct ExchangeResp {
696699
access_token: String,
697700
}
698-
let client = reqwest::Client::new();
701+
let client = reqwest::Client::builder()
702+
.use_rustls_tls()
703+
.build()
704+
.map_err(io::Error::other)?;
699705
let resp = client
700706
.post(format!("{issuer}/oauth/token"))
701707
.header("Content-Type", "application/x-www-form-urlencoded")

‎codex-rs/login/tests/suite/login_server_e2e.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ async fn end_to_end_login_flow_persists_auth_json() -> Result<()> {
130130

131131
// Simulate browser callback, and follow redirect to /success
132132
let client = reqwest::Client::builder()
133+
.use_rustls_tls()
133134
.redirect(reqwest::redirect::Policy::limited(5))
134135
.build()?;
135136
let url = format!("http://127.0.0.1:{login_port}/auth/callback?code=abc&state=test_state_123");
@@ -183,7 +184,7 @@ async fn creates_missing_codex_home_dir() -> Result<()> {
183184
let server = run_login_server(opts)?;
184185
let login_port = server.actual_port;
185186

186-
let client = reqwest::Client::new();
187+
let client = reqwest::Client::builder().use_rustls_tls().build().unwrap();
187188
let url = format!("http://127.0.0.1:{login_port}/auth/callback?code=abc&state=state2");
188189
let resp = client.get(&url).send().await?;
189190
assert!(resp.status().is_success());
@@ -228,7 +229,7 @@ async fn forced_chatgpt_workspace_id_mismatch_blocks_login() -> Result<()> {
228229
);
229230
let login_port = server.actual_port;
230231

231-
let client = reqwest::Client::new();
232+
let client = reqwest::Client::builder().use_rustls_tls().build().unwrap();
232233
let url = format!("http://127.0.0.1:{login_port}/auth/callback?code=abc&state={state}");
233234
let resp = client.get(&url).send().await?;
234235
assert!(resp.status().is_success());
@@ -305,7 +306,7 @@ async fn cancels_previous_login_server_when_port_is_in_use() -> Result<()> {
305306
.expect_err("login server should report cancellation");
306307
assert_eq!(cancel_result.kind(), io::ErrorKind::Interrupted);
307308

308-
let client = reqwest::Client::new();
309+
let client = reqwest::Client::builder().use_rustls_tls().build().unwrap();
309310
let cancel_url = format!("http://127.0.0.1:{login_port}/cancel");
310311
let resp = client.get(cancel_url).send().await?;
311312
assert!(resp.status().is_success());

‎codex-rs/ollama/src/client.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ impl OllamaClient {
6363
&& is_openai_compatible_base_url(base_url);
6464
let host_root = base_url_to_host_root(base_url);
6565
let client = reqwest::Client::builder()
66+
.use_rustls_tls()
6667
.connect_timeout(std::time::Duration::from_secs(5))
6768
.build()
68-
.unwrap_or_else(|_| reqwest::Client::new());
69+
.map_err(io::Error::other)?;
6970
let client = Self {
7071
client,
7172
host_root,
@@ -221,9 +222,10 @@ impl OllamaClient {
221222
#[cfg(test)]
222223
fn from_host_root(host_root: impl Into<String>) -> Self {
223224
let client = reqwest::Client::builder()
225+
.use_rustls_tls()
224226
.connect_timeout(std::time::Duration::from_secs(5))
225227
.build()
226-
.unwrap_or_else(|_| reqwest::Client::new());
228+
.expect("failed to build reqwest client");
227229
Self {
228230
client,
229231
host_root: host_root.into(),

‎codex-rs/rmcp-client/src/rmcp_client.rs‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ impl RmcpClient {
173173
http_config = http_config.auth_header(bearer_token);
174174
}
175175

176-
let http_client =
177-
apply_default_headers(reqwest::Client::builder(), &default_headers).build()?;
176+
let http_client = apply_default_headers(
177+
reqwest::Client::builder().use_rustls_tls(),
178+
&default_headers,
179+
)
180+
.build()?;
178181

179182
let transport = StreamableHttpClientTransport::with_client(http_client, http_config);
180183
PendingTransport::StreamableHttp { transport }
@@ -375,8 +378,11 @@ async fn create_oauth_transport_and_runtime(
375378
StreamableHttpClientTransport<AuthClient<reqwest::Client>>,
376379
OAuthPersistor,
377380
)> {
378-
let http_client =
379-
apply_default_headers(reqwest::Client::builder(), &default_headers).build()?;
381+
let http_client = apply_default_headers(
382+
reqwest::Client::builder().use_rustls_tls(),
383+
&default_headers,
384+
)
385+
.build()?;
380386
let mut oauth_state = OAuthState::new(url.to_string(), Some(http_client.clone())).await?;
381387

382388
oauth_state

‎package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
"ci:clippy": "cd codex-rs && cargo clippy --all-features --tests --profile dev -- -D warnings",
2323
"ci:build": "cd codex-rs && cargo build",
2424
"ci:test": "cd codex-rs && cargo test",
25-
"ci": "pnpm run ci:format && pnpm run ci:codespell && pnpm run ci:mcp-types && pnpm run ci:shear && pnpm run ci:clippy && pnpm run ci:build && pnpm run ci:test"
25+
"ci:checks": "concurrently -n format,spell,mcp,shear \"pnpm run ci:format\" \"pnpm run ci:codespell\" \"pnpm run ci:mcp-types\" \"pnpm run ci:shear\"",
26+
"ci": "pnpm run ci:checks && pnpm run ci:clippy && pnpm run ci:test"
2627
},
2728
"devDependencies": {
2829
"@codex-native/sdk": "workspace:*",
2930
"@napi-rs/cli": "^2.18.4",
31+
"concurrently": "^9.2.1",
3032
"prettier": "^3.5.3"
3133
},
3234
"resolutions": {

0 commit comments

Comments
 (0)