Skip to content

Commit dd79bcc

Browse files
committed
codex 0.143.0 + MIO patch update
1 parent e1e10a4 commit dd79bcc

7 files changed

Lines changed: 337 additions & 339 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ build/install/codex/bin/codex --version
6161
- The wrapper uses the official Solaris Rust standalone installer target
6262
`x86_64-pc-solaris`.
6363
- The pinned Codex source is the upstream `openai/codex` release tag
64-
`rust-v0.142.5`, built from its `codex-rs/` workspace.
64+
`rust-v0.143.0`, built from its `codex-rs/` workspace.
6565
- Set `SOLARIS_CODEX_PROXY_SETUP=/path/to/proxy.sh` if your host needs an
6666
environment hook before downloads.
6767
- The codex build clears inherited Solaris `LD_*` hardening variables because
@@ -111,7 +111,7 @@ vendored-crate rewrites in place:
111111

112112
Those helpers remain scripted because they also update vendored crate
113113
`.cargo-checksum.json`, which makes static patch files awkward to maintain.
114-
The mio event-ports rewrite applies the upstream proposal from
114+
The mio event-ports rewrite applies the upstream accepted changes from
115115
`https://github.com/tokio-rs/mio/pull/1962`, refreshed against the `mio 1.2.0`
116116
crate version locked by Codex.
117117

build-codex.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ paths = [
385385
"src/poll.rs",
386386
"src/sys/unix/mod.rs",
387387
"src/sys/unix/selector/event_ports.rs",
388+
"src/sys/unix/waker/event_ports.rs",
388389
]
389390
390391
data = json.loads(checksum_json.read_text())

patches/codex/0007-app-server-daemon-use-fcntl-locks-on-solaris.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ index b525e61..68c85dc 100644
6060
fn try_lock_file(_file: &fs::File) -> Result<bool> {
6161
bail!("pid-managed app-server startup is unsupported on this platform")
6262
diff --git a/codex-rs/app-server-daemon/src/lib.rs b/codex-rs/app-server-daemon/src/lib.rs
63-
index 21fecef..461bda0 100644
63+
index 5870075..95ff316 100644
6464
--- a/codex-rs/app-server-daemon/src/lib.rs
6565
+++ b/codex-rs/app-server-daemon/src/lib.rs
66-
@@ -823,7 +823,7 @@ fn should_reexec_updater(
66+
@@ -831,7 +831,7 @@ fn should_reexec_updater(
6767
&& outcome == RestartIfRunningOutcome::Restarted
6868
}
6969

@@ -72,7 +72,7 @@ index 21fecef..461bda0 100644
7272
fn try_lock_file(file: &tokio::fs::File) -> Result<bool> {
7373
use std::os::fd::AsRawFd;
7474

75-
@@ -839,6 +839,35 @@ fn try_lock_file(file: &tokio::fs::File) -> Result<bool> {
75+
@@ -847,6 +847,35 @@ fn try_lock_file(file: &tokio::fs::File) -> Result<bool> {
7676
Err(err).context("failed to lock daemon operation")
7777
}
7878

patches/codex/0008-http-client-honor-no-proxy-before-system-proxy.patch

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,25 @@ This was offered to upstream via:
1313
https://github.com/openai/codex/issues/4242
1414

1515
diff --git a/codex-rs/exec-server/src/client/reqwest_http_client.rs b/codex-rs/exec-server/src/client/reqwest_http_client.rs
16-
index 9e22fc0..1862197 100644
16+
index d0cffa6..dd849de 100644
1717
--- a/codex-rs/exec-server/src/client/reqwest_http_client.rs
1818
+++ b/codex-rs/exec-server/src/client/reqwest_http_client.rs
19-
@@ -46,17 +46,23 @@ pub(crate) struct PendingReqwestHttpBodyStream {
19+
@@ -49,20 +49,25 @@ pub(crate) struct PendingReqwestHttpBodyStream {
2020
/// Validates `http/request` parameters and runs the actual `reqwest` call used
2121
/// by the exec-server route and the local [`HttpClient`] backend.
2222
pub(crate) struct ReqwestHttpRequestRunner {
2323
- client: reqwest::Client,
2424
+ timeout_ms: Option<u64>,
25+
+ redirect_policy: HttpRedirectPolicy,
2526
}
2627

2728
impl ReqwestHttpClient {
28-
- fn build_client(timeout_ms: Option<u64>) -> Result<reqwest::Client, ExecServerError> {
29-
- let builder = match timeout_ms {
30-
+ fn build_client(
31-
+ timeout_ms: Option<u64>,
29+
fn build_client(
30+
timeout_ms: Option<u64>,
31+
redirect_policy: HttpRedirectPolicy,
3232
+ url: &Url,
33-
+ ) -> Result<reqwest::Client, ExecServerError> {
33+
) -> Result<reqwest::Client, ExecServerError> {
34+
- let builder = match timeout_ms {
3435
+ let mut builder = match timeout_ms {
3536
None => reqwest::Client::builder(),
3637
Some(timeout_ms) => {
@@ -40,32 +41,35 @@ index 9e22fc0..1862197 100644
4041
+ if request_matches_no_proxy(url) {
4142
+ builder = builder.no_proxy();
4243
+ }
43-
build_reqwest_client_with_custom_ca(builder)
44-
.map_err(|error| ExecServerError::HttpRequest(error.to_string()))
45-
}
46-
@@ -112,9 +118,7 @@ impl HttpClient for ReqwestHttpClient {
47-
48-
impl ReqwestHttpRequestRunner {
49-
pub(crate) fn new(timeout_ms: Option<u64>) -> Result<Self, JSONRPCErrorError> {
50-
- let client = ReqwestHttpClient::build_client(timeout_ms)
44+
let builder = match redirect_policy {
45+
HttpRedirectPolicy::Follow => builder,
46+
HttpRedirectPolicy::Stop => builder.redirect(reqwest::redirect::Policy::none()),
47+
@@ -125,9 +130,10 @@ impl ReqwestHttpRequestRunner {
48+
timeout_ms: Option<u64>,
49+
redirect_policy: HttpRedirectPolicy,
50+
) -> Result<Self, JSONRPCErrorError> {
51+
- let client = ReqwestHttpClient::build_client(timeout_ms, redirect_policy)
5152
- .map_err(|error| internal_error(error.to_string()))?;
5253
- Ok(Self { client })
53-
+ Ok(Self { timeout_ms })
54+
+ Ok(Self {
55+
+ timeout_ms,
56+
+ redirect_policy,
57+
+ })
5458
}
5559

5660
pub(crate) async fn run(
57-
@@ -136,7 +140,9 @@ impl ReqwestHttpRequestRunner {
58-
}
59-
60-
let headers = Self::build_headers(params.headers)?;
61+
@@ -159,7 +165,9 @@ impl ReqwestHttpRequestRunner {
62+
);
63+
let mut headers = Self::build_headers(params.headers)?;
64+
codex_otel::inject_span_w3c_trace_headers(&request_span, &mut headers);
6165
- let mut request = self.client.request(method.clone(), url).headers(headers);
62-
+ let client = ReqwestHttpClient::build_client(self.timeout_ms, &url)
66+
+ let client = ReqwestHttpClient::build_client(self.timeout_ms, self.redirect_policy, &url)
6367
+ .map_err(|error| internal_error(error.to_string()))?;
6468
+ let mut request = client.request(method.clone(), url).headers(headers);
6569
if let Some(body) = params.body {
6670
request = request.body(body.into_inner());
6771
}
68-
@@ -295,3 +301,98 @@ fn error_source_chain(error: &reqwest::Error) -> Option<String> {
72+
@@ -320,3 +328,98 @@ fn error_source_chain(error: &reqwest::Error) -> Option<String> {
6973
}
7074
(!sources.is_empty()).then(|| sources.join(": "))
7175
}

patches/codex/0010-exec-server-drain-fs-helper-output-concurrently.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ before it can exit. Add a regression test that returns a helper-shaped response
1010
larger than a typical pipe buffer.
1111

1212
diff --git a/codex-rs/exec-server/src/fs_sandbox.rs b/codex-rs/exec-server/src/fs_sandbox.rs
13-
index 3dbcf73..1ef9129 100644
13+
index 812d767..1286e8f 100644
1414
--- a/codex-rs/exec-server/src/fs_sandbox.rs
1515
+++ b/codex-rs/exec-server/src/fs_sandbox.rs
1616
@@ -17,6 +17,7 @@ use codex_sandboxing::SandboxablePreference;
@@ -21,7 +21,7 @@ index 3dbcf73..1ef9129 100644
2121
use tokio::io::AsyncWriteExt;
2222
use tokio::process::Command;
2323

24-
@@ -299,6 +300,25 @@ async fn run_command(
24+
@@ -302,6 +303,25 @@ async fn run_command(
2525
request_json: Vec<u8>,
2626
) -> Result<FsHelperPayload, JSONRPCErrorError> {
2727
let mut child = spawn_command(command)?;
@@ -47,7 +47,7 @@ index 3dbcf73..1ef9129 100644
4747
let mut stdin = child
4848
.stdin
4949
.take()
50-
@@ -307,15 +327,17 @@ async fn run_command(
50+
@@ -310,15 +330,17 @@ async fn run_command(
5151
stdin.shutdown().await.map_err(io_error)?;
5252
drop(stdin);
5353

@@ -70,7 +70,7 @@ index 3dbcf73..1ef9129 100644
7070
match response {
7171
FsHelperResponse::Ok(payload) => Ok(payload),
7272
FsHelperResponse::Error(error) => Err(error),
73-
@@ -358,6 +380,10 @@ fn io_error(err: std::io::Error) -> JSONRPCErrorError {
73+
@@ -361,6 +383,10 @@ fn io_error(err: std::io::Error) -> JSONRPCErrorError {
7474
internal_error(err.to_string())
7575
}
7676

@@ -81,7 +81,7 @@ index 3dbcf73..1ef9129 100644
8181
fn json_error(err: serde_json::Error) -> JSONRPCErrorError {
8282
internal_error(format!(
8383
"failed to encode or decode fs sandbox helper message: {err}"
84-
@@ -675,6 +701,58 @@ mod tests {
84+
@@ -678,6 +704,58 @@ mod tests {
8585
assert!(policy.can_read_path_with_cwd(alias_parent.as_path(), cwd.as_path()));
8686
}
8787

0 commit comments

Comments
 (0)