diff --git a/Cargo.lock b/Cargo.lock index 7197f7f..4ecd3b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,7 +221,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -232,7 +232,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -350,6 +350,18 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "async-compression" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "515a1f282e33d55983c499d7e9e87082e81cbc32974825bf9032f928392d5844" +dependencies = [ + "compression-codecs", + "compression-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "async-executor" version = "1.13.3" @@ -1493,8 +1505,8 @@ dependencies = [ [[package]] name = "codex-agent-identity" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "base64 0.22.1", @@ -1513,7 +1525,7 @@ dependencies = [ [[package]] name = "codex-api" -version = "0.169.0" +version = "0.171.0" dependencies = [ "anyhow", "assert_matches", @@ -1525,6 +1537,7 @@ dependencies = [ "codex-http-client", "codex-protocol", "codex-utils-rustls-provider", + "codex-utils-string", "codex-websocket-client", "eventsource-stream", "futures", @@ -1591,13 +1604,13 @@ dependencies = [ "tracing", "tracing-subscriber", "uuid", - "zstd", + "zstd 0.13.3", ] [[package]] name = "codex-async-utils" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "rand 0.9.3", "tokio", @@ -1606,8 +1619,8 @@ dependencies = [ [[package]] name = "codex-attachment-store" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "serde", "tracing", @@ -1615,8 +1628,8 @@ dependencies = [ [[package]] name = "codex-aws-auth" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "aws-config", "aws-credential-types", @@ -1635,8 +1648,8 @@ dependencies = [ [[package]] name = "codex-build-info" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-install-context", "semver", @@ -1646,8 +1659,8 @@ dependencies = [ [[package]] name = "codex-client" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-http-client", "eventsource-stream", @@ -1661,8 +1674,8 @@ dependencies = [ [[package]] name = "codex-code-mode" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-code-mode-protocol", "codex-http-client", @@ -1685,8 +1698,8 @@ dependencies = [ [[package]] name = "codex-code-mode-protocol" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-protocol", "glob", @@ -1703,13 +1716,13 @@ dependencies = [ [[package]] name = "codex-collaboration-mode-templates" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" [[package]] name = "codex-config" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "base64 0.22.1", @@ -1758,8 +1771,8 @@ dependencies = [ [[package]] name = "codex-connectors" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "arc-swap", @@ -1780,8 +1793,8 @@ dependencies = [ [[package]] name = "codex-context-fragments" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-protocol", "codex-utils-string", @@ -1790,8 +1803,8 @@ dependencies = [ [[package]] name = "codex-core-plugin-common" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-utils-absolute-path", "semver", @@ -1802,8 +1815,8 @@ dependencies = [ [[package]] name = "codex-exec-server" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "arc-swap", "axum", @@ -1860,8 +1873,8 @@ dependencies = [ [[package]] name = "codex-exec-server-protocol" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "base64 0.22.1", "codex-file-system", @@ -1878,8 +1891,8 @@ dependencies = [ [[package]] name = "codex-execpolicy" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "caseless", @@ -1898,8 +1911,8 @@ dependencies = [ [[package]] name = "codex-extension-items" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-utils-absolute-path", "schemars 0.8.22", @@ -1910,8 +1923,8 @@ dependencies = [ [[package]] name = "codex-features" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-network-proxy", "codex-protocol", @@ -1924,8 +1937,8 @@ dependencies = [ [[package]] name = "codex-feedback" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "bytes", @@ -1950,8 +1963,8 @@ dependencies = [ [[package]] name = "codex-file-search" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "clap", @@ -1965,8 +1978,8 @@ dependencies = [ [[package]] name = "codex-file-system" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "bytes", "codex-protocol", @@ -1980,8 +1993,8 @@ dependencies = [ [[package]] name = "codex-file-watcher" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "notify", "tokio", @@ -1990,8 +2003,8 @@ dependencies = [ [[package]] name = "codex-git-utils" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "chrono", @@ -2017,8 +2030,8 @@ dependencies = [ [[package]] name = "codex-guardian-context" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-context-fragments", "codex-history", @@ -2030,11 +2043,12 @@ dependencies = [ [[package]] name = "codex-history" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-protocol", "codex-utils-absolute-path", + "codex-utils-model-facing-id", "schemars 0.8.22", "serde", "serde_json", @@ -2042,8 +2056,8 @@ dependencies = [ [[package]] name = "codex-http-client" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "bytes", "codex-utils-rustls-provider", @@ -2072,13 +2086,27 @@ dependencies = [ "tracing-opentelemetry", "url", "windows-sys 0.61.2", - "zstd", + "zstd 0.13.3", +] + +[[package]] +name = "codex-http-headers-helper" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" +dependencies = [ + "anyhow", + "codex-utils-process", + "codex-utils-pty", + "http 1.4.0", + "serde", + "serde_json", + "tokio", ] [[package]] name = "codex-install-context" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-utils-absolute-path", "codex-utils-home-dir", @@ -2089,8 +2117,8 @@ dependencies = [ [[package]] name = "codex-keyring-store" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "keyring", "secret-service", @@ -2100,9 +2128,10 @@ dependencies = [ [[package]] name = "codex-linux-sandbox" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ + "async-lock", "clap", "codex-install-context", "codex-network-proxy", @@ -2111,23 +2140,27 @@ dependencies = [ "codex-sandboxing", "codex-uds", "codex-utils-absolute-path", + "etherparse", + "hickory-proto 0.26.3", "ignore", "indexmap 2.14.0", "landlock", "libc", + "rand 0.9.3", "rustix", "seccompiler", "serde", "serde_json", "sha2 0.10.9", - "tokio", + "smoltcp", + "socks5-protocol", "url", ] [[package]] name = "codex-login" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "base64 0.22.1", @@ -2166,8 +2199,8 @@ dependencies = [ [[package]] name = "codex-model-provider" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "chrono", @@ -2198,8 +2231,8 @@ dependencies = [ [[package]] name = "codex-model-provider-info" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-client", "codex-http-client", @@ -2212,8 +2245,8 @@ dependencies = [ [[package]] name = "codex-models-manager" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "chrono", "codex-http-client", @@ -2230,8 +2263,8 @@ dependencies = [ [[package]] name = "codex-mxc-sandbox" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "codex-network-proxy", @@ -2250,8 +2283,8 @@ dependencies = [ [[package]] name = "codex-network-proxy" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "aws-credential-types", @@ -2299,15 +2332,17 @@ dependencies = [ [[package]] name = "codex-otel" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "bytes", "chrono", "codex-api", "codex-http-client", + "codex-http-headers-helper", "codex-protocol", "codex-utils-absolute-path", + "codex-utils-process", "codex-utils-stream-parser", "codex-utils-string", "eventsource-stream", @@ -2333,8 +2368,8 @@ dependencies = [ [[package]] name = "codex-plugin" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-config", "codex-core-plugin-common", @@ -2348,16 +2383,16 @@ dependencies = [ [[package]] name = "codex-process-hardening" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "libc", ] [[package]] name = "codex-prompts" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "codex-collaboration-mode-templates", @@ -2369,12 +2404,13 @@ dependencies = [ "codex-utils-absolute-path", "codex-utils-template", "tracing", + "whoami 1.6.1", ] [[package]] name = "codex-protocol" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "chardetng", "chrono", @@ -2385,6 +2421,7 @@ dependencies = [ "codex-network-proxy", "codex-utils-absolute-path", "codex-utils-image", + "codex-utils-model-facing-id", "codex-utils-path-uri", "codex-utils-redacted-string", "codex-utils-string", @@ -2417,8 +2454,8 @@ dependencies = [ [[package]] name = "codex-response-debug-context" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "base64 0.22.1", "codex-api", @@ -2428,8 +2465,8 @@ dependencies = [ [[package]] name = "codex-rollout" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "chrono", @@ -2456,13 +2493,13 @@ dependencies = [ "tokio", "tracing", "uuid", - "zstd", + "zstd 0.13.3", ] [[package]] name = "codex-runtime-agent-instance" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "base64 0.22.1", "codex-agent-identity", @@ -2486,8 +2523,8 @@ dependencies = [ [[package]] name = "codex-sandboxing" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "codex-mxc-sandbox", @@ -2512,8 +2549,8 @@ dependencies = [ [[package]] name = "codex-secrets" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "age", "anyhow", @@ -2531,8 +2568,8 @@ dependencies = [ [[package]] name = "codex-shell-command" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "base64 0.22.1", "codex-protocol", @@ -2552,8 +2589,8 @@ dependencies = [ [[package]] name = "codex-skills" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-protocol", "codex-shell-command", @@ -2569,8 +2606,8 @@ dependencies = [ [[package]] name = "codex-state" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "chrono", @@ -2578,9 +2615,11 @@ dependencies = [ "codex-history", "codex-protocol", "codex-utils-absolute-path", + "codex-utils-model-facing-id", "file-id", "libsqlite3-sys", "log", + "rand 0.9.3", "serde", "serde_json", "sqlx", @@ -2596,16 +2635,16 @@ dependencies = [ [[package]] name = "codex-terminal-detection" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "tracing", ] [[package]] name = "codex-tools" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "bitflags 2.13.1", "codex-attachment-store", @@ -2629,8 +2668,8 @@ dependencies = [ [[package]] name = "codex-uds" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "async-io", "libc", @@ -2642,8 +2681,8 @@ dependencies = [ [[package]] name = "codex-utils-absolute-path" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "dirs", "dunce", @@ -2654,8 +2693,8 @@ dependencies = [ [[package]] name = "codex-utils-cache" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "lru", "sha1 0.10.6", @@ -2664,8 +2703,8 @@ dependencies = [ [[package]] name = "codex-utils-home-dir" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-utils-absolute-path", "dirs", @@ -2673,22 +2712,36 @@ dependencies = [ [[package]] name = "codex-utils-image" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "base64 0.22.1", "codex-utils-cache", "image", "mime_guess", + "moxcms", "png", "thiserror 2.0.18", "tokio", ] +[[package]] +name = "codex-utils-model-facing-id" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" +dependencies = [ + "blake3", + "schemars 0.8.22", + "serde", + "serde_json", + "thiserror 2.0.18", + "tracing", +] + [[package]] name = "codex-utils-output-truncation" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-protocol", "codex-utils-string", @@ -2697,8 +2750,8 @@ dependencies = [ [[package]] name = "codex-utils-path" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-utils-absolute-path", "dunce", @@ -2708,8 +2761,8 @@ dependencies = [ [[package]] name = "codex-utils-path-uri" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "base64 0.22.1", "codex-utils-absolute-path", @@ -2723,8 +2776,8 @@ dependencies = [ [[package]] name = "codex-utils-plugins" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-exec-server", "codex-exec-server-protocol", @@ -2736,19 +2789,20 @@ dependencies = [ [[package]] name = "codex-utils-process" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" [[package]] name = "codex-utils-pty" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "filedescriptor", "lazy_static", "libc", "log", + "nix 0.28.0", "portable-pty", "shared_library", "tokio", @@ -2757,8 +2811,8 @@ dependencies = [ [[package]] name = "codex-utils-redacted-string" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "schemars 0.8.22", "serde", @@ -2766,21 +2820,21 @@ dependencies = [ [[package]] name = "codex-utils-rustls-provider" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "rustls", ] [[package]] name = "codex-utils-stream-parser" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" [[package]] name = "codex-utils-string" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "regex-lite", "serde", @@ -2789,13 +2843,13 @@ dependencies = [ [[package]] name = "codex-utils-template" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" [[package]] name = "codex-websocket-auth" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "clap", @@ -2810,8 +2864,8 @@ dependencies = [ [[package]] name = "codex-websocket-client" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "codex-http-client", "futures", @@ -2824,8 +2878,8 @@ dependencies = [ [[package]] name = "codex-windows-sandbox" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ "anyhow", "base64 0.22.1", @@ -2853,14 +2907,19 @@ dependencies = [ [[package]] name = "codex-workload-identity" -version = "0.169.0" -source = "git+https://github.com/openai/codex.git?rev=d32063f96c2dff1dc96af839b3952abb6acfeda4#d32063f96c2dff1dc96af839b3952abb6acfeda4" +version = "0.171.0" +source = "git+https://github.com/openai/codex.git?rev=ccf9be8cc458bd6b8336fe84d68d8893f2691a5e#ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" dependencies = [ + "base64 0.22.1", "codex-http-client", + "prost", "serde", "serde_json", + "spiffe", "thiserror 2.0.18", "tokio", + "tonic", + "tonic-prost", "url", ] @@ -2886,6 +2945,25 @@ dependencies = [ "memchr", ] +[[package]] +name = "compression-codecs" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fe67f2944eef52fc7b106b8c9450d243a88701a0c065f7f57235e76abaed7df" +dependencies = [ + "compression-core", + "flate2", + "memchr", + "zstd 0.13.3", + "zstd-safe 7.2.4", +] + +[[package]] +name = "compression-core" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ebdda89edc534bf8d5dd2857562633b6495557e5846552ade994b99ed13c36a" + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -2947,9 +3025,12 @@ checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "constant_time_eq" -version = "0.4.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" +checksum = "9eb6feb175df65d0a3ccd3e73484e940d0ac664e8034f0519fd49a93db3071d9" +dependencies = [ + "rustversion", +] [[package]] name = "convert_case" @@ -3244,7 +3325,7 @@ dependencies = [ "openssl-sys", "schannel", "socket2 0.6.3", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -3259,7 +3340,7 @@ dependencies = [ "openssl-sys", "pkg-config", "vcpkg", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -3640,7 +3721,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -3949,7 +4030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -3968,6 +4049,15 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "etherparse" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17304d06addb3283cdc4bd528e42dd95e73c8ee2d6492ffce415e93660885449" +dependencies = [ + "arrayvec", +] + [[package]] name = "event-listener" version = "5.4.1" @@ -5298,6 +5388,16 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "heapless" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ba4bd83f9415b58b4ed8dc5714c76e626a105be4646c02630ad730ad3b5aa4" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + [[package]] name = "heck" version = "0.5.0" @@ -5341,6 +5441,25 @@ dependencies = [ "url", ] +[[package]] +name = "hickory-proto" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d" +dependencies = [ + "data-encoding", + "idna", + "ipnet", + "jni", + "once_cell", + "rand 0.10.1", + "ring", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "url", +] + [[package]] name = "hickory-resolver" version = "0.25.2" @@ -5349,7 +5468,7 @@ checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" dependencies = [ "cfg-if", "futures-util", - "hickory-proto", + "hickory-proto 0.25.2", "ipconfig", "moka", "once_cell", @@ -5604,7 +5723,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.3", + "socket2 0.5.10", "system-configuration", "tokio", "tower-service", @@ -5690,7 +5809,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core 0.58.0", ] [[package]] @@ -6366,9 +6485,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.29" +version = "1.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bc9657773828b90eeb625adff10eeac83cc21bbfd8e23a03eaa8a33c9e28d9" +checksum = "fee3f59f4321dab0c78d828942e7aa09d0bd8ad6e78a501977e6bf3d02938045" dependencies = [ "cc", "libc", @@ -6521,13 +6640,19 @@ dependencies = [ [[package]] name = "lzma-rust2" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde178a3caf126c440fa15628147772d8ee590a39477d711353fbe2e58a73a5b" +checksum = "7277c9742229dc25243236d578b6471a798c554512c6f6a04365ec2e87c2a3bb" dependencies = [ "sha2 0.11.0", ] +[[package]] +name = "managed" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" + [[package]] name = "maplit" version = "1.0.2" @@ -6808,6 +6933,18 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.31.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" +dependencies = [ + "bitflags 2.13.1", + "cfg-if", + "cfg_aliases 0.2.1", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -6866,7 +7003,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -7313,6 +7450,7 @@ dependencies = [ "tokio", "tonic", "tracing", + "zstd 0.13.3", ] [[package]] @@ -7610,9 +7748,9 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "png" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" dependencies = [ "bitflags 2.13.1", "crc32fast", @@ -8016,7 +8154,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.6.3", + "socket2 0.5.10", "thiserror 2.0.18", "tokio", "tracing", @@ -8025,9 +8163,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.18" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9746dbde176634f4f2f1faf2404e30a31b2bc1e9cafb5329c95d8177a18c9fc" +checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe" dependencies = [ "bytes", "getrandom 0.4.2", @@ -8047,16 +8185,16 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.14" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016" dependencies = [ "cfg_aliases 0.2.1", "libc", "once_cell", - "socket2 0.6.3", + "socket2 0.5.10", "tracing", - "windows-sys 0.60.2", + "windows-sys 0.59.0", ] [[package]] @@ -8727,8 +8865,8 @@ dependencies = [ [[package]] name = "rmcp" -version = "3.5.1" -source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=98a54789b80110ad210495c4ad845c89e1980471#98a54789b80110ad210495c4ad845c89e1980471" +version = "3.6.0" +source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=b11a40d889e022087d7f2b8cd23aa28e19ceaf5b#b11a40d889e022087d7f2b8cd23aa28e19ceaf5b" dependencies = [ "base64 0.23.0", "chrono", @@ -8750,8 +8888,8 @@ dependencies = [ [[package]] name = "rmcp-macros" -version = "3.5.1" -source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=98a54789b80110ad210495c4ad845c89e1980471#98a54789b80110ad210495c4ad845c89e1980471" +version = "3.6.0" +source = "git+https://github.com/modelcontextprotocol/rust-sdk?rev=b11a40d889e022087d7f2b8cd23aa28e19ceaf5b#b11a40d889e022087d7f2b8cd23aa28e19ceaf5b" dependencies = [ "darling 0.24.0", "proc-macro2", @@ -8828,7 +8966,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -8887,7 +9025,7 @@ dependencies = [ "security-framework 3.5.1", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -9602,6 +9740,21 @@ dependencies = [ "serde_core", ] +[[package]] +name = "smoltcp" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f8b28ad56c6e35524a37dd492af5d1a47e31e1a4d175cd12f89c075f01980f" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "cfg-if", + "defmt 1.1.1", + "heapless 0.9.3", + "libc", + "managed", +] + [[package]] name = "socket2" version = "0.5.10" @@ -9619,7 +9772,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", +] + +[[package]] +name = "socks5-protocol" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b4925e3858bd0a1ac69668653234b4bebb0d4cd32a111c31057837d3d99117" +dependencies = [ + "thiserror 1.0.69", + "tokio", ] [[package]] @@ -9632,6 +9795,20 @@ dependencies = [ "quickcheck", ] +[[package]] +name = "spiffe" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "539d8f20779006e7e078d8ac7f30a7d7d77fdbbf1f343e1d4416c22772850fbf" +dependencies = [ + "hyper-util", + "thiserror 2.0.18", + "tokio", + "tonic", + "tower", + "url", +] + [[package]] name = "spin" version = "0.9.8" @@ -9804,7 +9981,7 @@ dependencies = [ "time", "tracing", "uuid", - "whoami", + "whoami 2.1.2", ] [[package]] @@ -10154,7 +10331,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -10510,6 +10687,7 @@ dependencies = [ "async-trait", "base64 0.22.1", "bytes", + "h2", "http 1.4.0", "http-body 1.0.1", "http-body-util", @@ -10519,6 +10697,7 @@ dependencies = [ "percent-encoding", "pin-project", "rustls-native-certs", + "socket2 0.6.3", "sync_wrapper", "tokio", "tokio-rustls", @@ -10527,7 +10706,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", - "zstd", + "zstd 0.13.3", ] [[package]] @@ -10594,13 +10773,18 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ + "async-compression", "bitflags 2.13.1", "bytes", + "futures-core", "futures-util", "http 1.4.0", "http-body 1.0.1", + "http-body-util", "iri-string", "pin-project-lite", + "tokio", + "tokio-util", "tower", "tower-layer", "tower-service", @@ -11094,6 +11278,12 @@ dependencies = [ "wit-bindgen", ] +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" version = "0.2.108" @@ -11271,6 +11461,17 @@ dependencies = [ "winsafe", ] +[[package]] +name = "whoami" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" +dependencies = [ + "libredox", + "wasite", + "web-sys", +] + [[package]] name = "whoami" version = "2.1.2" @@ -11320,7 +11521,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] @@ -12171,13 +12372,13 @@ dependencies = [ [[package]] name = "zip" -version = "9.0.0" +version = "9.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711e8c9646791c49b7eb799a19c4ae70a9b8372ddc6a1fa4778defd1e2aa5d5e" +checksum = "6e04976da629d3b04204ba8105b396a193af8ad2583b2c79bfb3ab8af580a11e" dependencies = [ "aes 0.9.3", "bzip2", - "constant_time_eq 0.4.2", + "constant_time_eq 0.6.1", "crc32fast", "deflate64", "flate2", @@ -12186,13 +12387,14 @@ dependencies = [ "indexmap 2.14.0", "lzma-rust2", "memchr", + "nix 0.31.3", "pbkdf2 0.13.0", "sha1 0.11.0", "time", "typed-path", "zeroize", "zopfli", - "zstd", + "zstd 0.14.3", ] [[package]] @@ -12231,7 +12433,16 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe", + "zstd-safe 7.2.4", +] + +[[package]] +name = "zstd" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3ae9bf90af6e40197bef767eeefc46ad6397420fe873830bd85e5fbbfb3c70" +dependencies = [ + "zstd-safe 8.2.0", ] [[package]] @@ -12243,11 +12454,20 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded520f16b29e1a9b771c722221b2b0a0398c2316d9bb3c42b458a5414d7434b" +dependencies = [ + "zstd-sys", +] + [[package]] name = "zstd-sys" -version = "2.0.16+zstd.1.5.7" +version = "2.1.2+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" +checksum = "481ada9c543b2323cbb7bbdbb5249177fbf0188ed959ed2c15e4b22421c84ed3" dependencies = [ "cc", "pkg-config", @@ -12308,4 +12528,4 @@ dependencies = [ [[patch.unused]] name = "crossterm" version = "0.29.0" -source = "git+https://github.com/openai-oss-forks/crossterm?rev=ed1cdab335221515706178d68495bba2aed1924f#ed1cdab335221515706178d68495bba2aed1924f" +source = "git+https://github.com/openai-oss-forks/crossterm?rev=37ca4a27a9424ec5dbe6451f48c339d7b45f8d63#37ca4a27a9424ec5dbe6451f48c339d7b45f8d63" diff --git a/Cargo.toml b/Cargo.toml index 265c7c8..1c9a8c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,11 +3,11 @@ name = "codex-api-gateway" version = "0.1.0" edition = "2024" license = "Apache-2.0" -rust-version = "1.95" +rust-version = "1.99.1" [dependencies] -codex-context-fragments = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-websocket-client = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } +codex-context-fragments = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-websocket-client = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } tokio-tungstenite = "0.28" zstd = "0.13" anyhow = "1" @@ -31,22 +31,22 @@ opentelemetry = "0.31" opentelemetry_sdk = "0.31" opentelemetry-otlp = { version = "0.31", default-features = false, features = ["trace", "metrics", "logs", "http-proto", "reqwest-blocking-client", "reqwest-rustls"] } uuid = { version = "1", features = ["v4", "v5"] } -codex-api = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-client = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-http-client = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-login = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-model-provider = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-model-provider-info = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-models-manager = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-protocol = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-config = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } +codex-api = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-client = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-http-client = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-login = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-model-provider = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-model-provider-info = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-models-manager = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-protocol = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-config = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } -codex-features = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } +codex-features = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } -codex-tools = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } +codex-tools = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } -codex-exec-server = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } +codex-exec-server = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } [dev-dependencies] opentelemetry_sdk = { version = "0.31", features = ["testing"] } @@ -58,7 +58,7 @@ tempfile = "3" # Match upstream SQLx SQLite compatibility patches. sqlx-core = { git = "https://github.com/transact-rs/sqlx", rev = "10462fa4414c6c7f1ed1d39bb31678e3b726878c" } sqlx-sqlite = { git = "https://github.com/transact-rs/sqlx", rev = "10462fa4414c6c7f1ed1d39bb31678e3b726878c" } -crossterm = { git = "https://github.com/openai-oss-forks/crossterm", rev = "ed1cdab335221515706178d68495bba2aed1924f" } +crossterm = { git = "https://github.com/openai-oss-forks/crossterm", rev = "37ca4a27a9424ec5dbe6451f48c339d7b45f8d63" } tokio-tungstenite = { git = "https://github.com/openai-oss-forks/tokio-tungstenite", rev = "7447c427513cfe685f236e1ac0513c4ea3dd9c0b" } tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "bc589d684755a8c02da0fc7e58d0861cbfc306f1" } diff --git a/Dockerfile b/Dockerfile index e0dc7ce..216d694 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM rust:1.95.0-bookworm@sha256:6258907abe69656e41cd992e0b705cdcfabcbbe3db374f92ed2d47121282d4a1 AS build +FROM rust:1.99.1-bookworm@sha256:e6f2cff35d0f309acf8433b4f05878ed77092602c5065cc81801177da0bb3a9c AS build RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates cmake clang libssl-dev pkg-config \ && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index 9912a43..d5a0bb4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A gateway that uses your ChatGPT subscription through the Codex Rust libraries. Supports Responses, streaming, WebSocket, images, files, search and Realtime. -Built on Codex **0.169.0** and Rust **1.95.0**. +Built on Codex **0.171.0** and Rust **1.99.1**. The gateway loads your account's model catalog at startup, including `gpt-6-sol` and `gpt-6-luna` when available. Restart to refresh the catalog; diff --git a/baseline/codex-release.lock.json b/baseline/codex-release.lock.json index 02e6de2..99c2d6c 100644 --- a/baseline/codex-release.lock.json +++ b/baseline/codex-release.lock.json @@ -1,29 +1,29 @@ { "repository": "https://github.com/openai/codex.git", - "release": "0.169.0", - "tag": "rust-v0.169.0", - "tag_object": "a41fe5b443652cbdbee57717fbb9fd78d8d8b32a", - "commit": "d32063f96c2dff1dc96af839b3952abb6acfeda4", - "published_at": "2026-11-13T08:37:05Z", - "release_url": "https://github.com/openai/codex/releases/tag/rust-v0.169.0", + "release": "0.171.0", + "tag": "rust-v0.171.0", + "tag_object": "295eca93394bb83a6ec8e0841033f3997f97fcbd", + "commit": "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e", + "published_at": "2026-11-20T00:44:47Z", + "release_url": "https://github.com/openai/codex/releases/tag/rust-v0.171.0", "prerelease": false, "companions": [ { "asset": "bwrap-x86_64-unknown-linux-musl.tar.gz", - "url": "https://github.com/openai/codex/releases/download/rust-v0.169.0/bwrap-x86_64-unknown-linux-musl.tar.gz", - "sha256": "6eec6f2479d34fa2b7660d4f64ca3d9dd08a898920d5769cf1c3d4fd043f5d91", + "url": "https://github.com/openai/codex/releases/download/rust-v0.171.0/bwrap-x86_64-unknown-linux-musl.tar.gz", + "sha256": "5286c22a20fb4e8f24a207990296ebfbb06d99ad5ec560502880f3744fa3783b", "executable": "codex-resources/bwrap" }, { "asset": "codex-code-mode-host-x86_64-unknown-linux-musl.tar.gz", - "url": "https://github.com/openai/codex/releases/download/rust-v0.169.0/codex-code-mode-host-x86_64-unknown-linux-musl.tar.gz", - "sha256": "cbed6a8d25e8268792b757767fbc76d4c62e84bcf8ee4a63f97547f0de3aaceb", + "url": "https://github.com/openai/codex/releases/download/rust-v0.171.0/codex-code-mode-host-x86_64-unknown-linux-musl.tar.gz", + "sha256": "d78619030c1b8d0a4d9c9c67667c1bfa23ad9d9edc63d87ffeaa86796f3d868c", "executable": "codex-code-mode-host" } ], "binary": { "asset": "codex-x86_64-unknown-linux-musl.tar.gz", - "url": "https://github.com/openai/codex/releases/download/rust-v0.169.0/codex-x86_64-unknown-linux-musl.tar.gz", - "sha256": "9af4d751fce183faedea629437d5252dbf458eeb04130cf4f97be844621ea985" + "url": "https://github.com/openai/codex/releases/download/rust-v0.171.0/codex-x86_64-unknown-linux-musl.tar.gz", + "sha256": "01baa2e47809f8597be5b2f8abd4e4dfe3fb5bcb6e504c2fbaaad97056c15e8d" } } diff --git a/docs/codex-models.md b/docs/codex-models.md index 7aa13bf..f3dcda1 100644 --- a/docs/codex-models.md +++ b/docs/codex-models.md @@ -5,9 +5,9 @@ | Query parameter | Type / behavior | | --- | --- | -| `client_version` | Optional string; defaults to `0.169.0`. At most 128 ASCII letters, digits, `.`, `-`, `_`, `+`. | +| `client_version` | Optional string; defaults to `0.171.0`. At most 128 ASCII letters, digits, `.`, `-`, `_`, `+`. | -Example: `/backend-api/codex/models?client_version=0.169.0`. +Example: `/backend-api/codex/models?client_version=0.171.0`. The original `ModelsClient` fetches the catalog using the gateway's subscription. The complete upstream JSON is preserved, including fields outside the pinned model schema: diff --git a/docs/codex-responses.md b/docs/codex-responses.md index bcf46bf..2e4bef4 100644 --- a/docs/codex-responses.md +++ b/docs/codex-responses.md @@ -19,6 +19,6 @@ Codex session/routing metadata is forwarded, including `session-id`, `thread-id` Always SSE with native event payloads, including unknown event fields. Unlike `/v1/responses`, this endpoint does not assemble or rewrite terminal `response.output`. The original Codex parser validates the stream; interrupted streams never become synthetic success responses. -Codex 0.169.0 performs remote compaction through native Responses using a `compaction_trigger` input item. The separate [compact facade](responses-compact.md) is for applications that want a single JSON result. +Codex 0.171.0 performs remote compaction through native Responses using a `compaction_trigger` input item. The separate [compact facade](responses-compact.md) is for applications that want a single JSON result. Local shell, filesystem, custom and MCP tools still execute in the calling Codex. Native [images](images-generations.md) and [standalone search](search.md) use their corresponding gateway routes. diff --git a/docs/common.md b/docs/common.md index 3a9676f..56e3bba 100644 --- a/docs/common.md +++ b/docs/common.md @@ -75,4 +75,4 @@ Gateway errors use this shape; `message` describes the failure: Upstream HTTP failures preserve their status and body, which may be non-JSON, plus headers such as `Retry-After`; transparent native routes preserve all end-to-end headers. Once SSE or WebSocket starts, failures are conveyed as events or connection closure; HTTP 200 alone does not mean generation succeeded. -Public adapters reject unsupported parameters instead of silently pretending to implement them. Native Responses preserves unknown protocol fields; native images/search use the pinned Codex types. Compatibility targets Codex **0.169.0**, not every OpenAI service or future Codex release. +Public adapters reject unsupported parameters instead of silently pretending to implement them. Native Responses preserves unknown protocol fields; native images/search use the pinned Codex types. Compatibility targets Codex **0.171.0**, not every OpenAI service or future Codex release. diff --git a/docs/health.md b/docs/health.md index 9264cb3..6f3e2b7 100644 --- a/docs/health.md +++ b/docs/health.md @@ -3,7 +3,7 @@ `GET /healthz` · No authentication, body or query parameters required. ```json -{"status":"ok","codex_release":"0.169.0","codex_revision":"d32063f96c2dff1dc96af839b3952abb6acfeda4"} +{"status":"ok","codex_release":"0.171.0","codex_revision":"ccf9be8cc458bd6b8336fe84d68d8893f2691a5e"} ``` HTTP 200 confirms the gateway is running and reports its pinned source version. It does not call the upstream or guarantee current subscription validity, quota or model availability. diff --git a/docs/index.md b/docs/index.md index d1a640e..54bfab5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,7 +2,7 @@ [Common rules](common.md) · [Native routing and credentials](native.md) · [Pinned inventory](../baseline/api-inventory.json) · [Official counterpart mapping](../baseline/openai-api-counterparts.json) -Each page describes one logical endpoint and its aliases. The inventory is a snapshot of first-party routes audited against Codex 0.155.1; the gateway now uses 0.169.0. Transparent forwarding does not establish entitlement or full public API compatibility. `field?` means optional/nullable in the inventory's client revision; server-owned and additional fields are preserved. +Each page describes one logical endpoint and its aliases. The inventory is a snapshot of first-party routes audited against Codex 0.155.1; the gateway now uses 0.171.0. Transparent forwarding does not establish entitlement or full public API compatibility. `field?` means optional/nullable in the inventory's client revision; server-owned and additional fields are preserved. ## Public adapters diff --git a/docs/models.md b/docs/models.md index 97cb456..804793a 100644 --- a/docs/models.md +++ b/docs/models.md @@ -8,7 +8,7 @@ No request body or required query parameters. When `client_version` is present ( {"object":"list","data":[{"id":"gpt-5.5","object":"model","created":0,"owned_by":"openai"}]} ``` -At startup, the gateway fetches the current account catalog using Codex 0.169.0. Public Responses (HTTP and WebSocket) and compaction validate model names and capabilities against this snapshot, so newly available models such as `gpt-6-sol` and `gpt-6-luna` do not require a new bundled catalog. Restart the gateway to refresh it. +At startup, the gateway fetches the current account catalog using Codex 0.171.0. Public Responses (HTTP and WebSocket) and compaction validate model names and capabilities against this snapshot, so newly available models such as `gpt-6-sol` and `gpt-6-luna` do not require a new bundled catalog. Restart the gateway to refresh it. If fetching fails, times out (after at most 30 seconds), or returns an empty/invalid catalog, startup logs a warning and falls back to the pinned Codex bundled catalog. Models absent from that fallback remain unavailable through public Responses. This is not a complete image-model or OpenAI Platform model directory; image endpoints default to `gpt-image-2` separately. diff --git a/docs/native.md b/docs/native.md index 244f87c..f83f968 100644 --- a/docs/native.md +++ b/docs/native.md @@ -1,6 +1,6 @@ # Native routing -The gateway uses Codex **0.169.0** and retains the native route inventory audited against **0.155.1**. Source anchors in the endpoint pages refer to that inventory snapshot; upgrading the client does not establish continued upstream availability for every server-owned route. See the [endpoint index](index.md), [source inventory](../baseline/api-inventory.json) and [official API comparison](../baseline/openai-api-counterparts.json). These routes relay server-owned contracts; account entitlement and upstream validation still apply. +The gateway uses Codex **0.171.0** and retains the native route inventory audited against **0.155.1**. Source anchors in the endpoint pages refer to that inventory snapshot; upgrading the client does not establish continued upstream availability for every server-owned route. See the [endpoint index](index.md), [source inventory](../baseline/api-inventory.json) and [official API comparison](../baseline/openai-api-counterparts.json). These routes relay server-owned contracts; account entitlement and upstream validation still apply. | Gateway prefix | Upstream prefix | | --- | --- | diff --git a/docs/realtime.md b/docs/realtime.md index 1b0b611..71cc004 100644 --- a/docs/realtime.md +++ b/docs/realtime.md @@ -7,6 +7,6 @@ **Response:** full-duplex Realtime JSON text and native binary/control frames. Event payloads, transcription events, errors and close behavior are relayed; no Responses event conversion is applied. The configured timeout is an idle timeout. -The upstream is `https://api.openai.com/v1/realtime`. Use `X-Codex-Gateway-Authorization` for the gateway key and `Authorization` for an API key when starting a direct session. Codex 0.169.0 requires an API key for its direct Realtime connection. Its existing WebRTC-call sideband explicitly supports the ChatGPT authorization used to create that call; ordinary gateway Bearer mode reuses the gateway subscription for this case. Subscription access to arbitrary new public Realtime sessions is not established by the source. +The upstream is `https://api.openai.com/v1/realtime`. Use `X-Codex-Gateway-Authorization` for the gateway key and `Authorization` for an API key when starting a direct session. Codex 0.171.0 requires an API key for its direct Realtime connection. Its existing WebRTC-call sideband explicitly supports the ChatGPT authorization used to create that call; ordinary gateway Bearer mode reuses the gateway subscription for this case. Subscription access to arbitrary new public Realtime sessions is not established by the source. [Pinned sideband authorization](https://github.com/openai/codex/blob/be2951ea34f0d295ed0becf97079f92fa5f6950e/codex-rs/core/src/client.rs#L412) · [Pinned direct-session gate](https://github.com/openai/codex/blob/be2951ea34f0d295ed0becf97079f92fa5f6950e/codex-rs/core/src/realtime_conversation.rs#L1773) · [Official WebSocket guide](https://developers.openai.com/api/docs/guides/voice-websockets?api=realtime) diff --git a/docs/responses.md b/docs/responses.md index 20d43ef..6b5c5a1 100644 --- a/docs/responses.md +++ b/docs/responses.md @@ -35,7 +35,7 @@ Known reasoning efforts are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `reasoning.generate_summary` is accepted as a deprecated alias of `summary`. Explicit `reasoning.context` values are preserved; `auto` and `current_turn` select regular Responses because Lite requires `all_turns`. Omitted/null context retains the Lite default of `all_turns` when the request uses Lite (and is omitted for regular requests). Requests containing hosted `web_search` always use regular Responses, where the hosted tool can execute. See the [SDK compatibility suite and parameter audit](sdk-compatibility.md). -Message inputs accept `role` (`user`, `assistant`, `system`, `developer`) and string or Codex content arrays. Public `system` messages are forwarded as `developer` messages because Codex rejects the `system` input role. Their content and position are preserved, and explicit top-level `instructions` retain their content and are prepended as a classified developer message, matching Codex 0.169.0 (for both standard and lite requests). Text and image content, reasoning, function/custom calls and their outputs, web-search calls and Codex compaction items are supported. Functions/custom tools run in the caller, which submits their outputs in the next request. +Message inputs accept `role` (`user`, `assistant`, `system`, `developer`) and string or Codex content arrays. Public `system` messages are forwarded as `developer` messages because Codex rejects the `system` input role. Their content and position are preserved, and explicit top-level `instructions` retain their content and are prepended as a classified developer message, matching Codex 0.171.0 (for both standard and lite requests). Text and image content, reasoning, function/custom calls and their outputs, web-search calls and Codex compaction items are supported. Functions/custom tools run in the caller, which submits their outputs in the next request. HTTP continuation requires complete input history. `previous_response_id`, `background`, temperature/sampling controls and other unlisted top-level fields are not implemented here. `max_output_tokens` does not cap generated output; clients requiring a hard limit must not rely on it. diff --git a/docs/upgrade-0.171.0-validation.md b/docs/upgrade-0.171.0-validation.md new file mode 100644 index 0000000..373a225 --- /dev/null +++ b/docs/upgrade-0.171.0-validation.md @@ -0,0 +1,39 @@ +# Codex 0.171.0 upgrade validation + +核验日期:2026-11-21。由 0.169.0 升级至当日最新的官方稳定版 +[rust-v0.171.0](https://github.com/openai/codex/releases/tag/rust-v0.171.0), +固定提交 `ccf9be8cc458bd6b8336fe84d68d8893f2691a5e`。 + +## 改动 + +更新所有 Codex 依赖、Cargo.lock、运行时版本与当前版本文档。 +共享 registry 依赖按上游 Cargo.lock 对齐。同步 crossterm patch, +Rust 工具链和 Docker 构建基础镜像升级到 1.99.1,基础镜像继续固定 digest。 +官方 CLI、bwrap 和 Code Mode host 的下载地址与 SHA-256 均已更新并实测校验。 + +刷新 vendored codex-api 源码和上游集成测试,迁移并重新生成 raw-transport.patch。 +Realtime 补丁保留新版按协议选择默认语音的逻辑;网关测试的显式语音改用可选字段。 +公共 Responses 适配器对新增 request_country 使用上游默认的省略行为, +HTTP 和 WebSocket 测试均检查不会意外发送该字段。 + +## 验证 + +- `cargo fmt --all -- --check`:通过。 +- `cargo check --workspace --all-targets --locked`:通过。 +- `cargo clippy --workspace --all-targets --locked -- -D warnings`:通过。 +- `python3 scripts/fetch-codex-baseline.py`:官方版本及三个发布资源校验通过。 +- `python3 scripts/verify-codex-source.py`:通过。 +- `uv sync --locked --group live`:通过。 +- `cargo test --workspace --locked`:342 passed,0 failed,12 ignored。 +- `cargo test --locked --test gateway actual_ -- --ignored`:5 passed。 +- `cargo test --locked --test source_audit -- --ignored`:1 passed。 +- `docker build -t codex-api:upgrade-0.171.0 .`:通过。 +- `python3 scripts/smoke-container.py codex-api:upgrade-0.171.0`:通过。 + 镜像大小 112.4 MiB;启动、健康检查中的版本与提交、鉴权、模型目录、工具和受限路由均通过。 + +源码审计确认 72 个 Codex git 包、1005 个共享 registry 包、47 个未修改源码文件、 +6 个原样上游集成测试。仍仅修改六个上游文件,另加 raw.rs 和网关集成测试; +SSE parser 与 0.171.0 上游一致。 + +凭据相关 live 测试未运行;客户端测试使用本地模拟上游,容器使用模拟凭据。 +验证日志位于 `.cache/upgrade-0.171.0/`。镜像仅在本机构建,未发布或部署。 diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 6360c18..9ec55b3 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.95.0" +channel = "1.99.1" components = ["rustfmt", "clippy"] diff --git a/src/lib.rs b/src/lib.rs index e521daf..5b10346 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,5 +19,5 @@ pub mod transfers; pub mod transport; pub mod websocket; -pub const CODEX_RELEASE: &str = "0.169.0"; -pub const CODEX_REV: &str = "d32063f96c2dff1dc96af839b3952abb6acfeda4"; +pub const CODEX_RELEASE: &str = "0.171.0"; +pub const CODEX_REV: &str = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e"; diff --git a/src/lite_instructions.rs b/src/lite_instructions.rs index 9519407..8b06f2a 100644 --- a/src/lite_instructions.rs +++ b/src/lite_instructions.rs @@ -1,4 +1,4 @@ -// Adapted from Codex 0.169.0 core/context/base_instructions.rs; Apache-2.0. +// Adapted from Codex 0.171.0 core/context/base_instructions.rs; Apache-2.0. use codex_context_fragments::ContextualUserFragment; use codex_protocol::models::{ContentItem, ContentItemKind, input_text}; diff --git a/src/request.rs b/src/request.rs index 5d58db3..7ca0d4a 100644 --- a/src/request.rs +++ b/src/request.rs @@ -295,6 +295,7 @@ impl CreateResponse { client_metadata: Some(HashMap::new()), access_programs: None, prompt_cache_options: None, + request_country: Default::default(), }) } } diff --git a/tests/cases/response_types.rs b/tests/cases/response_types.rs index 42bb4a5..71b646c 100644 --- a/tests/cases/response_types.rs +++ b/tests/cases/response_types.rs @@ -56,7 +56,7 @@ async fn actual_openai_sdk_response_types() { let expected_lite = is_lite && context == "all_turns"; assert!( row.1["input"][0]["type"] != "additional_tools", - "requests without tools omit additional_tools in Codex 0.169.0" + "requests without tools omit additional_tools in Codex 0.171.0" ); assert_eq!( row.0.contains_key("x-openai-internal-codex-responses-lite"), diff --git a/tests/gateway.rs b/tests/gateway.rs index 9e26555..941483c 100644 --- a/tests/gateway.rs +++ b/tests/gateway.rs @@ -438,6 +438,7 @@ async fn stream_preserves_full_events_and_uses_codex_request_and_headers() { assert_eq!(body["model"], h.model); assert_eq!(body["stream"], true); assert_eq!(body["store"], false); + assert!(body.get("request_country").is_none()); assert_eq!(body["tool_choice"], "auto"); assert_eq!(body["include"], json!(["reasoning.encrypted_content"])); assert_eq!( @@ -1593,6 +1594,7 @@ async fn public_ws_accepts_sdk_input_and_builds_lite_request() { assert_eq!(body["reasoning"]["context"], "all_turns"); assert_eq!(body["generate"], false); assert_eq!(body["stream_id"], "lane-1"); + assert!(body.get("request_country").is_none()); assert_eq!( body["client_metadata"]["ws_request_header_x_openai_internal_codex_responses_lite"], "true" diff --git a/vendor/codex-api/Cargo.toml b/vendor/codex-api/Cargo.toml index 2409a0c..9221c22 100644 --- a/vendor/codex-api/Cargo.toml +++ b/vendor/codex-api/Cargo.toml @@ -1,7 +1,7 @@ -# Vendored from Codex rust-v0.169.0; workspace dependencies expanded. +# Vendored from Codex rust-v0.171.0; workspace dependencies expanded. [package] name = "codex-api" -version = "0.169.0" +version = "0.171.0" edition = "2024" license = "Apache-2.0" @@ -10,14 +10,15 @@ async-channel = { version = "2.3.1" } base64 = { version = "0.22.1" } bytes = { version = "1.10.1" } chrono = { version = "0.4.43" } -codex-client = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-http-client = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-protocol = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-utils-rustls-provider = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } -codex-websocket-client = { git = "https://github.com/openai/codex.git", rev = "d32063f96c2dff1dc96af839b3952abb6acfeda4" } +codex-client = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-http-client = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-protocol = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-utils-rustls-provider = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-utils-string = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } +codex-websocket-client = { git = "https://github.com/openai/codex.git", rev = "ccf9be8cc458bd6b8336fe84d68d8893f2691a5e" } futures = { version = "0.3", default-features = false } -rustls = { version = "0.23.46", default-features = false, features = ["aws_lc_rs", "std"] } http = { version = "1.3.1" } +rustls = { version = "0.23.46", default-features = false, features = ["aws_lc_rs", "std"] } schemars = { version = "0.8.22" } serde = { version = "1", features = ["rc", "derive"] } serde_json = { version = "1", features = ["raw_value"] } @@ -37,7 +38,6 @@ anyhow = { version = "1" } assert_matches = { version = "1.5.0" } pretty_assertions = { version = "1.4.1" } rcgen = { version = "0.14.7", default-features = false, features = ["aws_lc_rs", "pem"] } -rustls = { version = "0.23.46", default-features = false, features = ["aws_lc_rs", "std"] } tempfile = { version = "3.23.0" } tokio = { version = "1", features = ["test-util"] } tokio-test = { version = "0.4" } diff --git a/vendor/codex-api/src/api_bridge.rs b/vendor/codex-api/src/api_bridge.rs index 07958ed..4a65ddc 100644 --- a/vendor/codex-api/src/api_bridge.rs +++ b/vendor/codex-api/src/api_bridge.rs @@ -30,6 +30,7 @@ pub fn map_api_error(err: ApiError) -> CodexErr { ApiError::Transport(_) | ApiError::Api { .. } | ApiError::Stream(_) + | ApiError::WebsocketMessageTooLarge | ApiError::ContentFilter | ApiError::ResponseIncomplete(_) | ApiError::ContextWindowExceeded @@ -67,6 +68,9 @@ fn map_api_error_details(err: ApiError) -> CodexErr { CodexErr::new(CodexErrorDetails::RateLimitExceeded(message)) } ApiError::Stream(msg) => CodexErr::Stream(msg), + ApiError::WebsocketMessageTooLarge => { + CodexErr::new(CodexErrorDetails::WebsocketMessageTooLarge) + } ApiError::ContentFilter => CodexErr::new(CodexErrorDetails::ContentFilter), ApiError::ResponseIncomplete(incomplete) => { CodexErr::new(CodexErrorDetails::ResponseIncomplete(incomplete)) diff --git a/vendor/codex-api/src/common.rs b/vendor/codex-api/src/common.rs index 455836c..4e62543 100644 --- a/vendor/codex-api/src/common.rs +++ b/vendor/codex-api/src/common.rs @@ -16,6 +16,7 @@ use serde::Deserialize; use serde::Serialize; use serde_json::Value; use serde_json::value::RawValue; +use std::collections::BTreeMap; use std::collections::HashMap; use std::pin::Pin; use std::sync::Arc; @@ -78,6 +79,40 @@ pub struct MemorySummarizeOutput { #[derive(Clone, Debug)] pub struct ResponseId(pub String); +/// A bounded reason for removing a replayed reasoning item from model input. +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] +pub enum ReasoningRemovalReason { + OrganizationMismatch, + EndUserMismatch, + ModelMismatch, + PrefixMismatch, + TurnBoundary, + Other, +} + +impl ReasoningRemovalReason { + /// Every metric category, including unrecognized API reasons. + pub const ALL: [Self; 6] = [ + Self::OrganizationMismatch, + Self::EndUserMismatch, + Self::ModelMismatch, + Self::PrefixMismatch, + Self::TurnBoundary, + Self::Other, + ]; + + pub fn as_str(self) -> &'static str { + match self { + Self::OrganizationMismatch => "organization_mismatch", + Self::EndUserMismatch => "end_user_mismatch", + Self::ModelMismatch => "model_mismatch", + Self::PrefixMismatch => "prefix_mismatch", + Self::TurnBoundary => "turn_boundary", + Self::Other => "other", + } + } +} + #[derive(Debug)] pub enum ResponseEvent { Created { @@ -104,6 +139,9 @@ pub enum ResponseEvent { response_id: String, token_usage: Option, usage_metadata: Option, + /// Reported reasoning removals by bounded reason. Missing or non-array + /// reports are unavailable; an empty map means no removals were reported. + reasoning_removals: Option>, /// Did the model affirmatively end its turn? Some providers do not set this, /// so we rely on fallback logic when this is `None`. end_turn: Option, @@ -311,6 +349,8 @@ pub struct ResponsesApiRequest { pub client_metadata: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub access_programs: Option, + #[serde(skip_serializing_if = "codex_protocol::RequestCountry::is_omitted")] + pub request_country: codex_protocol::RequestCountry, } impl<'a> From<&'a ResponsesApiRequest> for ResponseCreateWsRequest<'a> { @@ -334,6 +374,7 @@ impl<'a> From<&'a ResponsesApiRequest> for ResponseCreateWsRequest<'a> { generate: None, client_metadata: request.client_metadata.clone(), access_programs: request.access_programs, + request_country: &request.request_country, } } } @@ -370,6 +411,8 @@ pub struct ResponseCreateWsRequest<'a> { pub client_metadata: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub access_programs: Option, + #[serde(skip_serializing_if = "codex_protocol::RequestCountry::is_omitted")] + pub request_country: &'a codex_protocol::RequestCountry, } pub fn response_create_client_metadata( diff --git a/vendor/codex-api/src/endpoint/realtime_call.rs b/vendor/codex-api/src/endpoint/realtime_call.rs index 745d0b0..c82ae02 100644 --- a/vendor/codex-api/src/endpoint/realtime_call.rs +++ b/vendor/codex-api/src/endpoint/realtime_call.rs @@ -10,6 +10,7 @@ use codex_client::HttpTransport; use codex_client::Request; use codex_client::RequestBody; use codex_client::RequestTelemetry; +use codex_protocol::protocol::RealtimeVoice; use http::HeaderMap; use http::HeaderValue; use http::Method; @@ -129,7 +130,7 @@ impl RealtimeCallClient { pub async fn create_with_session_and_headers( &self, sdp: String, - session_config: RealtimeSessionConfig, + mut session_config: RealtimeSessionConfig, extra_headers: HeaderMap, ) -> Result { trace!(target: "codex_api::realtime_websocket::wire", "realtime call request SDP: {sdp}"); @@ -137,6 +138,10 @@ impl RealtimeCallClient { // session payload is sent with call creation. Legacy sidebands still send session.update // after joining; Frameless sidebands attach to the session that is already running. validate_avas_session_config(&session_config)?; + if self.uses_backend_request_shape() { + // ChatGPT keeps its own default; API calls use the wire adapter's default. + session_config.voice.get_or_insert(RealtimeVoice::Cove); + } let event_parser = session_config.event_parser; let path = self.path_for_session(event_parser); let mut session = realtime_session_json(session_config)?; @@ -396,14 +401,14 @@ mod tests { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), } } fn realtime_v2_session_config(session_id: &str) -> RealtimeSessionConfig { RealtimeSessionConfig { event_parser: RealtimeEventParser::RealtimeV2, - voice: RealtimeVoice::Marin, + voice: Some(RealtimeVoice::Marin), ..realtime_session_config(session_id) } } @@ -559,32 +564,38 @@ mod tests { #[tokio::test] async fn sends_frameless_session_call_to_live_without_legacy_query_params() { - let transport = CapturingTransport::with_location("/v1/live/rtc_frameless"); - let client = RealtimeCallClient::new( - transport.clone(), - provider("https://api.openai.com/v1"), - Arc::new(DummyAuth), - ); - - let response = client - .create_with_session( - "v=offer\r\n".to_string(), - frameless_bidi_session_config("sess-api"), - ) - .await - .expect("request should succeed"); + for (voice, expected_voice) in [ + (None, "marin"), + (Some(RealtimeVoice::Marin), "marin"), + (Some(RealtimeVoice::Cove), "cove"), + ] { + let transport = CapturingTransport::with_location("/v1/live/rtc_frameless"); + let client = RealtimeCallClient::new( + transport.clone(), + provider("https://api.openai.com/v1"), + Arc::new(DummyAuth), + ); - assert_eq!(response.call_id, "rtc_frameless"); - let request = transport.last_request.lock().unwrap().clone().unwrap(); - assert_eq!(request.method, Method::POST); - assert_eq!(request.url, "https://api.openai.com/v1/live"); - let Some(RequestBody::Raw(body)) = request.body else { - panic!("multipart body should be raw"); - }; - let body = std::str::from_utf8(&body).expect("multipart body should be utf-8"); - assert!(body.contains("\"model\":\"gpt-realtime\"")); - assert!(body.contains("\"delegation\":{\"type\":\"client\"}")); - assert!(!body.contains("\"id\":\"sess-api\"")); + let mut session_config = frameless_bidi_session_config("sess-api"); + session_config.voice = voice; + let response = client + .create_with_session("v=offer\r\n".to_string(), session_config) + .await + .expect("request should succeed"); + + assert_eq!(response.call_id, "rtc_frameless"); + let request = transport.last_request.lock().unwrap().clone().unwrap(); + assert_eq!(request.method, Method::POST); + assert_eq!(request.url, "https://api.openai.com/v1/live"); + let Some(RequestBody::Raw(body)) = request.body else { + panic!("multipart body should be raw"); + }; + let body = std::str::from_utf8(&body).expect("multipart body should be utf-8"); + assert!(body.contains("\"model\":\"gpt-realtime\"")); + assert!(body.contains("\"delegation\":{\"type\":\"client\"}")); + assert!(!body.contains("\"id\":\"sess-api\"")); + assert!(body.contains(&format!("\"voice\":\"{expected_voice}\""))); + } } #[tokio::test] @@ -696,56 +707,60 @@ mod tests { #[tokio::test] async fn sends_backend_frameless_session_call_to_realtime_calls() { - let transport = CapturingTransport::with_location("/v1/live/rtc_backend_frameless"); - let client = RealtimeCallClient::new( - transport.clone(), - provider("https://chatgpt.com/backend-api/codex"), - Arc::new(DummyAuth), - ); - let mut session_config = frameless_bidi_session_config("sess-backend"); - session_config.initial_items = vec![ - ConversationTextParams { - text: "Remember this.".to_string(), - role: ConversationTextRole::Developer, - }, - ConversationTextParams { - text: "Understood.".to_string(), - role: ConversationTextRole::Assistant, - }, - ]; - - let response = client - .create_with_session("v=offer\r\n".to_string(), session_config) - .await - .expect("request should succeed"); - - assert_eq!(response.call_id, "rtc_backend_frameless"); - let request = transport.last_request.lock().unwrap().clone().unwrap(); - assert_eq!(request.method, Method::POST); - assert_eq!( - request.url, - "https://chatgpt.com/backend-api/codex/realtime/calls?intent=quicksilver&architecture=avas" - ); - let Some(RequestBody::Json(body)) = request.body else { - panic!("backend request body should be JSON"); - }; - assert_eq!(body["session"]["delegation"]["type"], "client"); - assert!(body["session"].get("id").is_none()); - assert_eq!( - body["session"]["initial_items"], - serde_json::json!([ - { - "type": "message", - "role": "developer", - "content": [{"type": "input_text", "text": "Remember this."}], + for (voice, expected_voice) in [(None, "cove"), (Some(RealtimeVoice::Maple), "maple")] { + let transport = CapturingTransport::with_location("/v1/live/rtc_backend_frameless"); + let client = RealtimeCallClient::new( + transport.clone(), + provider("https://chatgpt.com/backend-api/codex"), + Arc::new(DummyAuth), + ); + let mut session_config = frameless_bidi_session_config("sess-backend"); + session_config.voice = voice; + session_config.initial_items = vec![ + ConversationTextParams { + text: "Remember this.".to_string(), + role: ConversationTextRole::Developer, }, - { - "type": "message", - "role": "assistant", - "content": [{"type": "output_text", "text": "Understood."}], + ConversationTextParams { + text: "Understood.".to_string(), + role: ConversationTextRole::Assistant, }, - ]) - ); + ]; + + let response = client + .create_with_session("v=offer\r\n".to_string(), session_config) + .await + .expect("request should succeed"); + + assert_eq!(response.call_id, "rtc_backend_frameless"); + let request = transport.last_request.lock().unwrap().clone().unwrap(); + assert_eq!(request.method, Method::POST); + assert_eq!( + request.url, + "https://chatgpt.com/backend-api/codex/realtime/calls?intent=quicksilver&architecture=avas" + ); + let Some(RequestBody::Json(body)) = request.body else { + panic!("backend request body should be JSON"); + }; + assert_eq!(body["session"]["delegation"]["type"], "client"); + assert_eq!(body["session"]["audio"]["output"]["voice"], expected_voice); + assert!(body["session"].get("id").is_none()); + assert_eq!( + body["session"]["initial_items"], + serde_json::json!([ + { + "type": "message", + "role": "developer", + "content": [{"type": "input_text", "text": "Remember this."}], + }, + { + "type": "message", + "role": "assistant", + "content": [{"type": "output_text", "text": "Understood."}], + }, + ]) + ); + } } #[tokio::test] diff --git a/vendor/codex-api/src/endpoint/realtime_websocket/methods.rs b/vendor/codex-api/src/endpoint/realtime_websocket/methods.rs index f0e39ba..4469327 100644 --- a/vendor/codex-api/src/endpoint/realtime_websocket/methods.rs +++ b/vendor/codex-api/src/endpoint/realtime_websocket/methods.rs @@ -1158,6 +1158,7 @@ impl RealtimeWebsocketClient { RealtimeSessionInitialization::ExistingCall => false, }; if initialize_session { + let voice = config.voice_or_default(); debug!( session_id = config.session_id.as_deref().unwrap_or(""), "realtime websocket sending session.update" @@ -1169,7 +1170,7 @@ impl RealtimeWebsocketClient { config.initial_items, config.session_mode, config.output_modality, - config.voice, + voice, config.delegation_ack_filler, ) .await?; @@ -2669,7 +2670,7 @@ mod tests { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Breeze, + voice: Some(RealtimeVoice::Breeze), }, HeaderMap::new(), HeaderMap::new(), @@ -2995,7 +2996,7 @@ mod tests { event_parser: RealtimeEventParser::RealtimeV2, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cedar, + voice: Some(RealtimeVoice::Cedar), }, HeaderMap::new(), HeaderMap::new(), @@ -3122,7 +3123,7 @@ mod tests { event_parser: RealtimeEventParser::RealtimeV2, session_mode: RealtimeSessionMode::Transcription, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Marin, + voice: Some(RealtimeVoice::Marin), }, HeaderMap::new(), HeaderMap::new(), @@ -3228,7 +3229,7 @@ mod tests { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Transcription, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), }, HeaderMap::new(), HeaderMap::new(), @@ -3320,7 +3321,7 @@ mod tests { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), }, HeaderMap::new(), HeaderMap::new(), diff --git a/vendor/codex-api/src/endpoint/realtime_websocket/methods_auth_tests.rs b/vendor/codex-api/src/endpoint/realtime_websocket/methods_auth_tests.rs index 1e62197..ddc84c6 100644 --- a/vendor/codex-api/src/endpoint/realtime_websocket/methods_auth_tests.rs +++ b/vendor/codex-api/src/endpoint/realtime_websocket/methods_auth_tests.rs @@ -70,7 +70,7 @@ fn session() -> RealtimeSessionConfig { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cedar, + voice: Some(RealtimeVoice::Cedar), } } diff --git a/vendor/codex-api/src/endpoint/realtime_websocket/methods_common.rs b/vendor/codex-api/src/endpoint/realtime_websocket/methods_common.rs index e5482e0..5133f2a 100644 --- a/vendor/codex-api/src/endpoint/realtime_websocket/methods_common.rs +++ b/vendor/codex-api/src/endpoint/realtime_websocket/methods_common.rs @@ -138,17 +138,16 @@ pub(super) fn session_update_message( } pub fn session_update_session_json(config: RealtimeSessionConfig) -> JsonResult { + let voice = config.voice_or_default(); match config.event_parser { RealtimeWireAdapter::V1 | RealtimeWireAdapter::RealtimeV2 => { let mut session = match config.event_parser { - RealtimeWireAdapter::V1 => { - v1_session_update_session(config.instructions, config.voice) - } + RealtimeWireAdapter::V1 => v1_session_update_session(config.instructions, voice), RealtimeWireAdapter::RealtimeV2 => v2_session_update_session( config.instructions, config.session_mode, config.output_modality, - config.voice, + voice, ), RealtimeWireAdapter::FramelessBidi => unreachable!(), }; @@ -160,7 +159,7 @@ pub fn session_update_session_json(config: RealtimeSessionConfig) -> JsonResult< config.model, config.instructions, config.initial_items, - config.voice, + voice, config.delegation_ack_filler, )), } diff --git a/vendor/codex-api/src/endpoint/realtime_websocket/protocol.rs b/vendor/codex-api/src/endpoint/realtime_websocket/protocol.rs index b7fc073..1053a79 100644 --- a/vendor/codex-api/src/endpoint/realtime_websocket/protocol.rs +++ b/vendor/codex-api/src/endpoint/realtime_websocket/protocol.rs @@ -44,7 +44,19 @@ pub struct RealtimeSessionConfig { pub event_parser: RealtimeEventParser, pub session_mode: RealtimeSessionMode, pub output_modality: RealtimeOutputModality, - pub voice: RealtimeVoice, + /// Leave unset to select the default for the API or ChatGPT call destination. + pub voice: Option, +} + +impl RealtimeSessionConfig { + pub(super) fn voice_or_default(&self) -> RealtimeVoice { + self.voice.unwrap_or(match self.event_parser { + RealtimeEventParser::V1 => RealtimeVoice::Cove, + RealtimeEventParser::FramelessBidi | RealtimeEventParser::RealtimeV2 => { + RealtimeVoice::Marin + } + }) + } } #[derive(Debug, Clone, Serialize)] diff --git a/vendor/codex-api/src/endpoint/responses.rs b/vendor/codex-api/src/endpoint/responses.rs index a1ca133..96af00e 100644 --- a/vendor/codex-api/src/endpoint/responses.rs +++ b/vendor/codex-api/src/endpoint/responses.rs @@ -57,6 +57,16 @@ impl ResponsesClient { } } + pub async fn stream_request( + &self, + request: ResponsesApiRequest, + options: ResponsesOptions, + ) -> Result { + self.stream_request_with_observer(request, options, |_| {}) + .await + } + + /// Gives the observer a shared copy of the exact JSON before transport dispatch. #[instrument( name = "responses.stream_request", level = "info", @@ -67,10 +77,11 @@ impl ResponsesClient { api.path = "/responses" ) )] - pub async fn stream_request( + pub async fn stream_request_with_observer( &self, request: ResponsesApiRequest, options: ResponsesOptions, + on_encoded: impl FnOnce(&bytes::Bytes), ) -> Result { let ResponsesOptions { session_id, @@ -83,6 +94,7 @@ impl ResponsesClient { let body = EncodedJsonBody::encode(&request) .map_err(|e| ApiError::Stream(format!("failed to encode responses request: {e}")))?; + on_encoded(body.shared_bytes()); let mut headers = extra_headers; if let Some(ref thread_id) = thread_id { insert_header(&mut headers, "x-client-request-id", thread_id); diff --git a/vendor/codex-api/src/endpoint/responses_websocket.rs b/vendor/codex-api/src/endpoint/responses_websocket.rs index ae05bc5..e4de8ef 100644 --- a/vendor/codex-api/src/endpoint/responses_websocket.rs +++ b/vendor/codex-api/src/endpoint/responses_websocket.rs @@ -42,11 +42,13 @@ use tokio::sync::oneshot; use tokio::time::Instant; use tokio_tungstenite::tungstenite::Error as WsError; use tokio_tungstenite::tungstenite::Message; +use tokio_tungstenite::tungstenite::Utf8Bytes; use tokio_tungstenite::tungstenite::client::IntoClientRequest; use tokio_tungstenite::tungstenite::handshake::client::Response; use tokio_tungstenite::tungstenite::protocol::CloseFrame; use tokio_tungstenite::tungstenite::protocol::frame::Fragment; use tokio_tungstenite::tungstenite::protocol::frame::Frame; +use tokio_tungstenite::tungstenite::protocol::frame::coding::CloseCode; use tokio_tungstenite::tungstenite::protocol::frame::coding::Data; use tracing::Instrument; use tracing::Span; @@ -60,6 +62,7 @@ use tungstenite::protocol::WebSocketConfig; use url::Url; struct WsStream { + max_message_bytes: Option, routing_affinity: Option, tx_command: mpsc::Sender, rx_message: mpsc::UnboundedReceiver>, @@ -104,7 +107,7 @@ async fn send_message( } impl WsStream { - fn new(inner: WebSocketConnection) -> Self { + fn new(inner: WebSocketConnection, max_message_bytes: Option) -> Self { let routing_affinity = inner.routing_affinity().cloned(); let (tx_command, mut rx_command) = mpsc::channel::(32); let (tx_message, rx_message) = mpsc::unbounded_channel::>(); @@ -163,6 +166,7 @@ impl WsStream { }); Self { + max_message_bytes, routing_affinity, tx_command, rx_message, @@ -203,6 +207,7 @@ impl Drop for WsStream { } const X_CODEX_TURN_STATE_HEADER: &str = "x-codex-turn-state"; +const X_CODEX_WEBSOCKET_MAX_MESSAGE_BYTES_HEADER: &str = "x-codex-websocket-max-message-bytes"; const X_MODELS_ETAG_HEADER: &str = "x-models-etag"; const X_REASONING_INCLUDED_HEADER: &str = "x-reasoning-included"; const OPENAI_MODEL_HEADER: &str = "openai-model"; @@ -279,17 +284,29 @@ impl ResponsesWebsocketConnection { .is_none_or(|stream| stream.pump_task.is_finished()) } + pub async fn stream_request( + &self, + request: ResponsesWsRequest<'_>, + connection_reused: bool, + turn_state: Option>>, + ) -> Result { + self.stream_request_with_observer(request, connection_reused, turn_state, |_| {}) + .await + } + + /// Gives the observer a shared copy of the exact JSON before transport dispatch. #[instrument( name = "responses_websocket.stream_request", level = "info", skip_all, fields(transport = "responses_websocket", api.path = "/responses") )] - pub async fn stream_request( + pub async fn stream_request_with_observer( &self, request: ResponsesWsRequest<'_>, connection_reused: bool, turn_state: Option>>, + on_encoded: impl FnOnce(&bytes::Bytes), ) -> Result { let (tx_event, rx_event) = mpsc::channel::>(1600); @@ -324,7 +341,8 @@ impl ResponsesWebsocketConnection { warmup: ws_request.generate == Some(false), connection_reused, }; - let request_text = serialize_websocket_request(&request)?; + let request_text = Utf8Bytes::from(serialize_websocket_request(&request)?); + on_encoded(request_text.as_ref()); let current_span = Span::current(); tokio::spawn( @@ -694,6 +712,11 @@ async fn connect_websocket( } }; + let max_message_bytes = response + .headers() + .get(X_CODEX_WEBSOCKET_MAX_MESSAGE_BYTES_HEADER) + .and_then(|value| value.to_str().ok()) + .and_then(|value| value.parse::().ok()); let reasoning_included = response.headers().contains_key(X_REASONING_INCLUDED_HEADER); let server_model = response .headers() @@ -709,7 +732,7 @@ async fn connect_websocket( let _ = turn_state.set(header_value.to_string()); } Ok(( - WsStream::new(stream), + WsStream::new(stream, max_message_bytes), response, reasoning_included, server_model, @@ -893,7 +916,7 @@ fn is_websocket_receive_failure( async fn run_websocket_response_stream( ws_stream: &mut WsStream, tx_event: mpsc::Sender>, - request_text: String, + request_text: Utf8Bytes, idle_timeout: Duration, telemetry: Option>, turn_state: Option<&OnceLock>, @@ -923,6 +946,7 @@ async fn run_websocket_response_stream( let mut interrupt_request = interrupt.clone().fuse(); let mut interruption = None; let mut response_id = None; + let mut received_text = false; let mut awaiting_interrupt_ack = false; loop { let poll_start = Instant::now(); @@ -938,7 +962,7 @@ async fn run_websocket_response_stream( "type": "response.interrupt", "response_id": response_id, "mode": "discard_partial_items", - }).to_string(), + }).to_string().into(), idle_timeout, /*telemetry*/ None, timing_log_context.connection_reused, @@ -971,6 +995,7 @@ async fn run_websocket_response_stream( match message { Message::Text(text) => { + received_text = true; let event = serde_json::from_str::(&text); let kind = event.as_ref().ok().map(ResponsesStreamEvent::kind); if let Some(t) = telemetry.as_ref() { @@ -1108,6 +1133,9 @@ async fn run_websocket_response_stream( Message::Binary(_) => { return Err(ApiError::Stream("unexpected binary websocket event".into())); } + Message::Close(Some(frame)) if frame.code == CloseCode::Size && !received_text => { + return Err(ApiError::WebsocketMessageTooLarge); + } Message::Close(_) => { return Err(ApiError::Stream( "websocket closed by server before response.completed".into(), @@ -1165,19 +1193,22 @@ fn safety_buffering_for_event( async fn send_websocket_request( ws_stream: &mut WsStream, - request_text: String, + request_text: Utf8Bytes, idle_timeout: Duration, telemetry: Option<&Arc>, connection_reused: bool, ) -> Result<(), ApiError> { + if ws_stream + .max_message_bytes + .is_some_and(|limit| request_text.len() > limit) + { + return Err(ApiError::WebsocketMessageTooLarge); + } let request_start = Instant::now(); - let result = tokio::time::timeout( - idle_timeout, - ws_stream.send(Message::Text(request_text.into())), - ) - .await - .map_err(|_| ApiError::Stream("idle timeout sending websocket request".into())) - .and_then(|result| result.map_err(map_ws_stream_error)); + let result = tokio::time::timeout(idle_timeout, ws_stream.send(Message::Text(request_text))) + .await + .map_err(|_| ApiError::Stream("idle timeout sending websocket request".into())) + .and_then(|result| result.map_err(map_ws_stream_error)); if let Some(t) = telemetry.as_ref() { t.on_ws_request( @@ -1215,7 +1246,22 @@ mod tests { #[test] fn direct_serialization_preserves_websocket_request_payload() { + for (country_code, expected_country) in [ + (None, None), + (Some(" de "), Some(json!("DE"))), + (Some("xX"), Some(Value::Null)), + ] { + assert_serialized_request(country_code, expected_country); + } + } + + fn assert_serialized_request(country_code: Option<&str>, expected_country: Option) { let api_request = ResponsesApiRequest { + request_country: country_code + .map(codex_protocol::RequestCountry::from_iso_code) + .transpose() + .expect("country is valid") + .unwrap_or_default(), model: "gpt-test".to_string(), input: vec![ResponseItem::Message { status: None, @@ -1268,6 +1314,10 @@ mod tests { let mut expected_payload = serde_json::to_value(&api_request).expect("serialize responses API request"); + assert_eq!( + expected_payload.get("request_country"), + expected_country.as_ref() + ); expected_payload["type"] = json!("response.create"); expected_payload["previous_response_id"] = json!("resp-1"); expected_payload["generate"] = json!(false); @@ -1279,6 +1329,10 @@ mod tests { let wire_payload = serde_json::from_str::(&request_text).expect("parse websocket request"); + assert_eq!( + wire_payload.get("request_country"), + expected_country.as_ref() + ); assert_eq!(wire_payload, expected_payload); } diff --git a/vendor/codex-api/src/error.rs b/vendor/codex-api/src/error.rs index 2793335..a853c7b 100644 --- a/vendor/codex-api/src/error.rs +++ b/vendor/codex-api/src/error.rs @@ -15,6 +15,8 @@ pub enum ApiError { Api { status: StatusCode, message: String }, #[error("stream error: {0}")] Stream(String), + #[error("websocket request exceeds the peer's message size limit")] + WebsocketMessageTooLarge, #[error("stream error: Incomplete response returned, reason: content_filter")] ContentFilter, #[error(transparent)] diff --git a/vendor/codex-api/src/lib.rs b/vendor/codex-api/src/lib.rs index 5c78525..13a30af 100644 --- a/vendor/codex-api/src/lib.rs +++ b/vendor/codex-api/src/lib.rs @@ -18,6 +18,7 @@ pub(crate) mod telemetry; /// Path of the Responses endpoint, relative to a provider's base URL. pub const RESPONSES_PATH: &str = "/responses"; +pub use crate::requests::headers::build_realtime_thread_headers; pub use crate::requests::headers::build_session_headers; pub use codex_client::RequestTelemetry; pub use codex_client::ReqwestTransport; @@ -42,6 +43,7 @@ pub use crate::common::RawMemory; pub use crate::common::RawMemoryMetadata; pub use crate::common::Reasoning; pub use crate::common::ReasoningContext; +pub use crate::common::ReasoningRemovalReason; pub use crate::common::ReasoningSummaryDelivery; pub use crate::common::ResponseCreateWsRequest; pub use crate::common::ResponseEvent; diff --git a/vendor/codex-api/src/requests/headers.rs b/vendor/codex-api/src/requests/headers.rs index c5cede8..9c02f9a 100644 --- a/vendor/codex-api/src/requests/headers.rs +++ b/vendor/codex-api/src/requests/headers.rs @@ -1,7 +1,27 @@ use codex_protocol::protocol::SessionSource; +use codex_protocol::protocol::ThreadSource; +use codex_utils_string::to_ascii_json_string; use http::HeaderMap; use http::HeaderValue; +/// Correlate both the media call and its observer with the same thread and session tree. +pub fn build_realtime_thread_headers( + session_id: String, + thread_id: String, + thread_source: Option, +) -> HeaderMap { + let mut headers = build_session_headers(Some(session_id), Some(thread_id)); + // Voice calls can span zero or many backing turns. Only the saved thread source applies. + if let Some(source) = thread_source + && source.as_str().len() <= 256 + && let Ok(metadata) = to_ascii_json_string(&serde_json::json!({ "thread_source": source })) + && let Ok(value) = HeaderValue::from_str(&metadata) + { + headers.insert("x-codex-turn-metadata", value); + } + headers +} + pub fn build_session_headers(session_id: Option, thread_id: Option) -> HeaderMap { let mut headers = HeaderMap::new(); if let Some(id) = session_id { diff --git a/vendor/codex-api/src/sse/responses.rs b/vendor/codex-api/src/sse/responses.rs index 9c12aae..eafc92d 100644 --- a/vendor/codex-api/src/sse/responses.rs +++ b/vendor/codex-api/src/sse/responses.rs @@ -1,4 +1,5 @@ use super::responses_error::parse_failed_response; +use crate::common::ReasoningRemovalReason; use crate::common::ResponseEvent; use crate::common::ResponseStream; use crate::common::SafetyBuffering; @@ -21,6 +22,7 @@ use eventsource_stream::Eventsource; use futures::StreamExt; use serde::Deserialize; use serde_json::Value; +use std::collections::BTreeMap; use std::sync::Arc; use std::sync::OnceLock; use std::time::Duration; @@ -372,6 +374,29 @@ impl ResponsesEventError { } } +// Diagnostic fields are optional and must never make an otherwise valid response fail. +fn reasoning_removals(response: &Value) -> Option> { + let transformations = response.get("input_transformations")?.as_array()?; + let mut counts = BTreeMap::new(); + for transformation in transformations { + if transformation.get("type").and_then(Value::as_str) != Some("reasoning") + || transformation.get("action").and_then(Value::as_str) != Some("removed") + { + continue; + } + let reason = match transformation.get("reason").and_then(Value::as_str) { + Some("organization_mismatch") => ReasoningRemovalReason::OrganizationMismatch, + Some("end_user_mismatch") => ReasoningRemovalReason::EndUserMismatch, + Some("model_mismatch") => ReasoningRemovalReason::ModelMismatch, + Some("prefix_mismatch") => ReasoningRemovalReason::PrefixMismatch, + Some("turn_boundary") => ReasoningRemovalReason::TurnBoundary, + _ => ReasoningRemovalReason::Other, + }; + *counts.entry(reason).or_default() += 1; + } + Some(counts) +} + pub fn process_responses_event( event: ResponsesStreamEvent, ) -> std::result::Result, ResponsesEventError> { @@ -492,6 +517,7 @@ pub fn process_responses_event( } } if let Some(resp_val) = event.response { + let reasoning_removals = reasoning_removals(&resp_val); let metadata = resp_val .get("usage") .filter(|usage| !usage.is_null()) @@ -505,6 +531,7 @@ pub fn process_responses_event( response_id: resp.id, token_usage: resp.usage.map(Into::into), usage_metadata: resp.usage_metadata, + reasoning_removals, end_turn: if interrupted { Some(false) } else { @@ -881,6 +908,7 @@ mod tests { response_id, token_usage, usage_metadata, + reasoning_removals: _, end_turn, }) => { assert_eq!(response_id, "resp1"); @@ -1079,6 +1107,7 @@ mod tests { response_id, token_usage, usage_metadata, + reasoning_removals: _, end_turn, }) => { assert_eq!(response_id, "resp1"); @@ -1675,6 +1704,7 @@ mod tests { response_id, token_usage: None, usage_metadata: None, + reasoning_removals: None, end_turn: None, } if response_id == "resp-1" ); @@ -1716,6 +1746,7 @@ mod tests { response_id, token_usage: None, usage_metadata: None, + reasoning_removals: None, end_turn: None, } if response_id == "resp-1" ); @@ -1752,6 +1783,7 @@ mod tests { response_id, token_usage: None, usage_metadata: None, + reasoning_removals: None, end_turn: None, } if response_id == "resp-1" ); @@ -1788,6 +1820,7 @@ mod tests { response_id, token_usage: None, usage_metadata: None, + reasoning_removals: None, end_turn: None, } if response_id == "resp-1" ); diff --git a/vendor/codex-api/tests/clients.rs b/vendor/codex-api/tests/clients.rs index fc96b30..a32de4f 100644 --- a/vendor/codex-api/tests/clients.rs +++ b/vendor/codex-api/tests/clients.rs @@ -335,6 +335,7 @@ async fn responses_client_stream_request_preserves_item_ids() -> Result<()> { let transport = RecordingTransport::new(state.clone()); let client = ResponsesClient::new(transport, provider("openai"), Arc::new(NoAuth)); let request = ResponsesApiRequest { + request_country: Default::default(), model: "gpt-test".into(), input: vec![ResponseItem::Message { status: None, @@ -392,6 +393,7 @@ async fn responses_client_stream_request_sends_routing_fields_ahead_of_large_inp // buffering a potentially multi-megabyte prompt first. let large_input = "x".repeat(2 * 1024 * 1024); let request = ResponsesApiRequest { + request_country: Default::default(), model: "gpt-test".into(), input: vec![ResponseItem::Message { status: None, @@ -491,6 +493,7 @@ async fn streaming_client_retries_on_transport_error() -> Result<()> { provider.retry.max_attempts = 2; let request = ResponsesApiRequest { + request_country: Default::default(), model: "gpt-test".into(), input: Vec::new(), tools: Some(empty_tools().into()), @@ -609,6 +612,7 @@ async fn azure_store_sends_ids_and_headers() -> Result<()> { let client = ResponsesClient::new(transport, provider("azure"), Arc::new(NoAuth)); let request = ResponsesApiRequest { + request_country: Default::default(), model: "gpt-test".into(), input: vec![ResponseItem::Message { status: None, diff --git a/vendor/codex-api/tests/gateway_extensions.rs b/vendor/codex-api/tests/gateway_extensions.rs index bffcbbb..01dfdae 100644 --- a/vendor/codex-api/tests/gateway_extensions.rs +++ b/vendor/codex-api/tests/gateway_extensions.rs @@ -41,7 +41,7 @@ fn config() -> RealtimeSessionConfig { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), } } diff --git a/vendor/codex-api/tests/models_integration.rs b/vendor/codex-api/tests/models_integration.rs index 49443c6..ea38637 100644 --- a/vendor/codex-api/tests/models_integration.rs +++ b/vendor/codex-api/tests/models_integration.rs @@ -170,6 +170,7 @@ async fn models_client_hits_models_endpoint() { tool_mode: None, multi_agent_version: None, multi_agent_reasoning_effort: None, + multi_agent_tools_in_code_mode: None, }], }; diff --git a/vendor/codex-api/tests/realtime_websocket_e2e.rs b/vendor/codex-api/tests/realtime_websocket_e2e.rs index d42d4ec..f78d4f1 100644 --- a/vendor/codex-api/tests/realtime_websocket_e2e.rs +++ b/vendor/codex-api/tests/realtime_websocket_e2e.rs @@ -162,7 +162,7 @@ async fn realtime_ws_e2e_session_create_and_event_flow() { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), }, HeaderMap::new(), HeaderMap::new(), @@ -268,7 +268,7 @@ async fn realtime_ws_connect_webrtc_sideband_retries_join_until_server_is_availa event_parser: RealtimeEventParser::RealtimeV2, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Marin, + voice: Some(RealtimeVoice::Marin), }, "rtc_test", HeaderMap::new(), @@ -349,7 +349,7 @@ async fn realtime_ws_existing_call_retries_activation_404_with_a_bounded_budget( event_parser: RealtimeEventParser::RealtimeV2, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Marin, + voice: Some(RealtimeVoice::Marin), }, "rtc_prepared", HeaderMap::new(), @@ -405,7 +405,7 @@ async fn realtime_ws_existing_call_transport_close_preserves_session() { event_parser, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Marin, + voice: Some(RealtimeVoice::Marin), }, "rtc_frontend_owned", HeaderMap::new(), @@ -461,7 +461,7 @@ async fn realtime_ws_frameless_session_close_still_ends_session() { event_parser: RealtimeEventParser::FramelessBidi, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Marin, + voice: Some(RealtimeVoice::Marin), }, "rtc_session_owner", HeaderMap::new(), @@ -525,7 +525,7 @@ async fn realtime_ws_e2e_send_while_next_event_waits() { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), }, HeaderMap::new(), HeaderMap::new(), @@ -595,7 +595,7 @@ async fn realtime_ws_e2e_disconnected_emitted_once() { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), }, HeaderMap::new(), HeaderMap::new(), @@ -661,7 +661,7 @@ async fn realtime_ws_e2e_ignores_unknown_text_events() { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), }, HeaderMap::new(), HeaderMap::new(), @@ -770,7 +770,7 @@ async fn realtime_ws_e2e_realtime_v2_parser_emits_handoff_requested() { event_parser: RealtimeEventParser::RealtimeV2, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Marin, + voice: Some(RealtimeVoice::Marin), }, HeaderMap::new(), HeaderMap::new(), diff --git a/vendor/codex-api/tests/realtime_websocket_tls.rs b/vendor/codex-api/tests/realtime_websocket_tls.rs index 5668ff6..e1c9eca 100644 --- a/vendor/codex-api/tests/realtime_websocket_tls.rs +++ b/vendor/codex-api/tests/realtime_websocket_tls.rs @@ -145,7 +145,7 @@ async fn check_connection(address: String) { event_parser: RealtimeEventParser::V1, session_mode: RealtimeSessionMode::Conversational, output_modality: RealtimeOutputModality::Audio, - voice: RealtimeVoice::Cove, + voice: Some(RealtimeVoice::Cove), }, HeaderMap::new(), HeaderMap::new(), diff --git a/vendor/codex-api/tests/sse_end_to_end.rs b/vendor/codex-api/tests/sse_end_to_end.rs index 0a7f148..cc54fa3 100644 --- a/vendor/codex-api/tests/sse_end_to_end.rs +++ b/vendor/codex-api/tests/sse_end_to_end.rs @@ -174,6 +174,7 @@ async fn responses_stream_parses_items_and_completed_end_to_end() -> Result<()> response_id, token_usage, usage_metadata, + reasoning_removals: _, end_turn, } => { assert_eq!(response_id, "resp1"); diff --git a/vendor/raw-transport.patch b/vendor/raw-transport.patch index a5e0642..7fb3dde 100644 --- a/vendor/raw-transport.patch +++ b/vendor/raw-transport.patch @@ -124,7 +124,7 @@ pub async fn connect( &self, config: RealtimeSessionConfig, -@@ -1090,17 +1125,83 @@ +@@ -1090,17 +1125,84 @@ session_initialization: RealtimeSessionInitialization, transcript_state: RealtimeTranscriptState, ) -> Result { @@ -161,6 +161,7 @@ + RealtimeSessionInitialization::ExistingCall => false, + }; + if initialize_session { ++ let voice = config.voice_or_default(); + debug!( + session_id = config.session_id.as_deref().unwrap_or(""), + "realtime websocket sending session.update" @@ -172,7 +173,7 @@ + config.initial_items, + config.session_mode, + config.output_modality, -+ config.voice, ++ voice, + config.delegation_ack_filler, + ) + .await?; @@ -213,7 +214,7 @@ request.headers_mut().extend(headers); if let Some(auth) = &self.auth { let headers = std::mem::take(request.headers_mut()); -@@ -1132,52 +1233,30 @@ +@@ -1132,53 +1234,30 @@ let (stream, response) = connector .connect(request, websocket_config()) .await @@ -256,6 +257,7 @@ - RealtimeSessionInitialization::ExistingCall => false, - }; - if initialize_session { +- let voice = config.voice_or_default(); - debug!( - session_id = config.session_id.as_deref().unwrap_or(""), - "realtime websocket sending session.update" @@ -267,7 +269,7 @@ - config.initial_items, - config.session_mode, - config.output_modality, -- config.voice, +- voice, - config.delegation_ack_filler, - ) - .await?; @@ -296,7 +298,7 @@ pub use methods::RealtimeWebsocketConnection; --- a/src/endpoint/responses.rs +++ b/src/endpoint/responses.rs -@@ -120,6 +120,20 @@ +@@ -132,6 +132,20 @@ .await } @@ -319,7 +321,7 @@ body: EncodedJsonBody, --- a/src/endpoint/responses_websocket.rs +++ b/src/endpoint/responses_websocket.rs -@@ -484,6 +484,52 @@ +@@ -502,6 +502,52 @@ .await } @@ -372,7 +374,7 @@ /// Opens a WebSocket connection long enough to validate the upgrade response. /// /// The probe uses the same URL construction, headers, authentication, TLS, -@@ -668,6 +714,35 @@ +@@ -691,6 +737,35 @@ reasoning_included, server_model, )) @@ -410,7 +412,7 @@ fn websocket_config() -> WebSocketConfig { --- a/src/lib.rs +++ b/src/lib.rs -@@ -61,11 +61,13 @@ +@@ -63,11 +63,13 @@ pub use crate::endpoint::ImagesClient; pub use crate::endpoint::MemoriesClient; pub use crate::endpoint::ModelsClient; @@ -424,7 +426,7 @@ pub use crate::endpoint::RealtimeSessionConfig; pub use crate::endpoint::RealtimeSessionMode; pub use crate::endpoint::RealtimeTranscriptState; -@@ -86,6 +88,7 @@ +@@ -88,6 +90,7 @@ pub use crate::error::ApiError; pub use crate::files::HostedFileUploadContext; pub use crate::files::OPENAI_FILE_UPLOAD_LIMIT_BYTES;