From f579388d521334532811bcb30fe1046b429dfac9 Mon Sep 17 00:00:00 2001 From: andrewgu-oai Date: Fri, 13 Nov 2026 18:54:33 +0000 Subject: [PATCH] Remove unused workspace entries and simplify Rust code (#61379) ## What changed - Remove the `codex-v8-poc`, `sentry`, and `syntect` workspace dependency entries and the `codex-v8-poc` entry from the `cargo-machete` ignore list. - Remove unnecessary clones from MCP configuration and web search serialization tests. - Simplify the final protected-metadata check in `WritableRoot::is_path_writable` to return the negated predicate directly. GitOrigin-RevId: 80c1dd3106fc24c0767696936c719bb1fbb47227 --- codex-rs/Cargo.toml | 4 ---- codex-rs/config/src/mcp_types_tests.rs | 2 +- codex-rs/protocol/src/models.rs | 6 +++--- codex-rs/protocol/src/protocol.rs | 6 +----- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/codex-rs/Cargo.toml b/codex-rs/Cargo.toml index d50ce4aac7..8d998fccde 100644 --- a/codex-rs/Cargo.toml +++ b/codex-rs/Cargo.toml @@ -340,7 +340,6 @@ codex-utils-stream-parser = { path = "utils/stream-parser" } codex-utils-string = { path = "utils/string" } codex-utils-template = { path = "utils/template" } codex-user-verification = { path = "user-verification" } -codex-v8-poc = { path = "v8-poc" } codex-workload-identity = { path = "workload-identity" } codex-windows-sandbox = { path = "windows-sandbox-rs" } codex-windows-sandbox-test-support = { path = "windows-sandbox-rs/tests/support" } @@ -488,7 +487,6 @@ rustls-pki-types = "1.14.0" schemars = "0.8.22" seccompiler = "0.5.0" semver = "1.0" -sentry = "0.46.0" serde = { version = "1", features = ["rc"] } serde_ignored = "0.1.14" serde_json = "1" @@ -529,7 +527,6 @@ starlark = { version = "0.14.2", default-features = false } strum = "0.27.2" strum_macros = "0.28.0" supports-color = "3.0.2" -syntect = "5" sys-locale = "0.3.2" system-configuration = "0.7" tar = { version = "=0.4.45", default-features = false } @@ -646,7 +643,6 @@ unwrap_used = "deny" ignored = [ "icu_provider", "openssl-sys", - "codex-v8-poc", ] [profile.dev] diff --git a/codex-rs/config/src/mcp_types_tests.rs b/codex-rs/config/src/mcp_types_tests.rs index baae2e8549..d893b0779e 100644 --- a/codex-rs/config/src/mcp_types_tests.rs +++ b/codex-rs/config/src/mcp_types_tests.rs @@ -539,7 +539,7 @@ fn serialize_round_trips_server_config_with_omitted_tool_exposure_surfaces() { let config = format!("command = \"echo\"\nomit_tools_from = [{serialized_surfaces}]\n"); let cfg: McpServerConfig = toml::from_str(&config).expect("should deserialize omitted MCP exposure surfaces"); - assert_eq!(cfg.omit_tools_from, Some(omitted_surfaces.clone())); + assert_eq!(cfg.omit_tools_from, Some(omitted_surfaces)); let serialized = toml::to_string(&cfg).expect("should serialize MCP config"); assert!(serialized.contains(&format!("omit_tools_from = [{serialized_surfaces}]"))); diff --git a/codex-rs/protocol/src/models.rs b/codex-rs/protocol/src/models.rs index 827785df7c..97fa5985c0 100644 --- a/codex-rs/protocol/src/models.rs +++ b/codex-rs/protocol/src/models.rs @@ -4141,9 +4141,9 @@ mod tests { let parsed: ResponseItem = serde_json::from_str(json_literal)?; let expected = ResponseItem::WebSearchCall { encrypted_content: None, - id: expected_id.clone(), - status: expected_status.clone(), - action: expected_action.clone(), + id: expected_id, + status: expected_status, + action: expected_action, internal_chat_message_metadata_passthrough: None, }; assert_eq!(parsed, expected); diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index cb89b25150..5d05de3864 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -1353,11 +1353,7 @@ impl WritableRoot { } } - if self.path_contains_protected_metadata_name(path) { - return false; - } - - true + !self.path_contains_protected_metadata_name(path) } fn path_contains_protected_metadata_name(&self, path: &Path) -> bool {