diff --git a/codex-rs/app-server/src/config_manager_service.rs b/codex-rs/app-server/src/config_manager_service.rs index 111c98e3e..31bc9742c 100644 --- a/codex-rs/app-server/src/config_manager_service.rs +++ b/codex-rs/app-server/src/config_manager_service.rs @@ -669,9 +669,9 @@ fn compute_override_metadata( effective: &TomlValue, segments: &[String], ) -> Option { - let user_value = match layers.get_active_user_layer() { - Some(user_layer) => value_at_path(&user_layer.config, segments), - None => return None, + let user_value = { + let user_layer = layers.get_active_user_layer()?; + value_at_path(&user_layer.config, segments) }; let effective_value = value_at_path(effective, segments); diff --git a/codex-rs/app-server/src/message_processor.rs b/codex-rs/app-server/src/message_processor.rs index 2d7be519f..f399fbb29 100644 --- a/codex-rs/app-server/src/message_processor.rs +++ b/codex-rs/app-server/src/message_processor.rs @@ -1155,7 +1155,7 @@ impl MessageProcessor { ClientRequest::RemoteDispatchReceiptRead { params, .. } => { self.remote_dispatch_processor.receipt_read(params).await } - ClientRequest::ConfigRequirementsRead { params: _, .. } => self + ClientRequest::ConfigRequirementsRead { .. } => self .config_processor .config_requirements_read() .await @@ -1208,7 +1208,7 @@ impl MessageProcessor { .unwatch(connection_id, params) .await .map(|response| Some(response.into())), - ClientRequest::ModelProviderCapabilitiesRead { params: _, .. } => self + ClientRequest::ModelProviderCapabilitiesRead { .. } => self .config_processor .model_provider_capabilities_read() .await @@ -1806,7 +1806,7 @@ impl MessageProcessor { .thread_realtime_stop(&request_id, params) .await } - ClientRequest::ThreadRealtimeListVoices { params: _, .. } => { + ClientRequest::ThreadRealtimeListVoices { .. } => { self.turn_processor.thread_realtime_list_voices().await } ClientRequest::ReviewStart { params, .. } => { diff --git a/codex-rs/app-server/tests/suite/v2/turn_start_zsh_fork.rs b/codex-rs/app-server/tests/suite/v2/turn_start_zsh_fork.rs index dfb76ecbc..84d2c194f 100644 --- a/codex-rs/app-server/tests/suite/v2/turn_start_zsh_fork.rs +++ b/codex-rs/app-server/tests/suite/v2/turn_start_zsh_fork.rs @@ -563,7 +563,7 @@ async fn turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2() let mut target_decision_index = 0; let first_file_str = first_file.to_string_lossy().into_owned(); let second_file_str = second_file.to_string_lossy().into_owned(); - let parent_shell_hint = format!("&& {}", &first_file_str); + let parent_shell_hint = format!("&& {first_file_str}"); while target_decision_index < target_decisions.len() || !saw_parent_approval { let server_req = timeout( DEFAULT_READ_TIMEOUT, diff --git a/codex-rs/core-plugins/src/manifest.rs b/codex-rs/core-plugins/src/manifest.rs index 606ca8147..ce3cc6400 100644 --- a/codex-rs/core-plugins/src/manifest.rs +++ b/codex-rs/core-plugins/src/manifest.rs @@ -139,7 +139,7 @@ enum RawPluginManifestPath { enum RawPluginManifestHooks { Path(String), Paths(Vec), - Inline(HooksFile), + Inline(Box), InlineList(Vec), Invalid(JsonValue), } @@ -283,7 +283,7 @@ fn resolve_manifest_hooks( .collect::>(); (!hooks.is_empty()).then_some(PluginManifestHooks::Paths(hooks)) } - RawPluginManifestHooks::Inline(hooks) => Some(PluginManifestHooks::Inline(vec![hooks])), + RawPluginManifestHooks::Inline(hooks) => Some(PluginManifestHooks::Inline(vec![*hooks])), RawPluginManifestHooks::InlineList(hooks) => { (!hooks.is_empty()).then_some(PluginManifestHooks::Inline(hooks)) } diff --git a/codex-rs/core/tests/suite/tools.rs b/codex-rs/core/tests/suite/tools.rs index 7949abfb6..4f7993091 100644 --- a/codex-rs/core/tests/suite/tools.rs +++ b/codex-rs/core/tests/suite/tools.rs @@ -289,7 +289,7 @@ async fn sandbox_denied_shell_command_returns_original_output() -> Result<()> { "printf {sentinel:?}; printf {content:?} > {path:?}", sentinel = format!("{sentinel}\n"), content = "sandbox denied", - path = &target_path + path = target_path ); let args = json!({ "command": command, diff --git a/codex-rs/exec-server/src/environment_toml.rs b/codex-rs/exec-server/src/environment_toml.rs index 26c178b5b..f124d8d85 100644 --- a/codex-rs/exec-server/src/environment_toml.rs +++ b/codex-rs/exec-server/src/environment_toml.rs @@ -845,15 +845,15 @@ include_local = false environment_provider_from_codex_home(codex_home.path()).expect("environment provider"); let snapshot = provider.snapshot().await.expect("environments"); - let environment_ids: Vec<_> = snapshot - .environments - .into_iter() - .map(|(id, _environment)| id) - .collect(); assert!(!snapshot.include_local); - assert!(!environment_ids.contains(&LOCAL_ENVIRONMENT_ID.to_string())); assert_eq!(snapshot.default, EnvironmentDefault::Disabled); + assert!( + !snapshot + .environments + .into_iter() + .any(|(id, _environment)| id == LOCAL_ENVIRONMENT_ID) + ); } #[tokio::test] @@ -864,17 +864,17 @@ include_local = false environment_provider_from_codex_home(codex_home.path()).expect("environment provider"); let snapshot = provider.snapshot().await.expect("environments"); - let environment_ids: Vec<_> = snapshot - .environments - .into_iter() - .map(|(id, _environment)| id) - .collect(); assert!(snapshot.include_local); - assert!(!environment_ids.contains(&LOCAL_ENVIRONMENT_ID.to_string())); assert_eq!( snapshot.default, EnvironmentDefault::EnvironmentId(LOCAL_ENVIRONMENT_ID.to_string()) ); + assert!( + !snapshot + .environments + .into_iter() + .any(|(id, _environment)| id == LOCAL_ENVIRONMENT_ID) + ); } } diff --git a/codex-rs/external-agent-migration/src/lib.rs b/codex-rs/external-agent-migration/src/lib.rs index 8b207eaee..97f22981d 100644 --- a/codex-rs/external-agent-migration/src/lib.rs +++ b/codex-rs/external-agent-migration/src/lib.rs @@ -374,7 +374,8 @@ fn mcp_server_toml_table( if let Some(env) = server_config.get("env").and_then(JsonValue::as_object) { append_env_config(&mut table, env)?; } - } else if let Some(url) = server_config.get("url").and_then(json_string) { + } else { + let url = server_config.get("url").and_then(json_string)?; if !matches!( transport_type, None | Some("http") | Some("streamable_http") @@ -388,8 +389,6 @@ fn mcp_server_toml_table( if let Some(headers) = server_config.get("headers").and_then(JsonValue::as_object) { append_header_config(&mut table, headers)?; } - } else { - return None; } Some(table) diff --git a/codex-rs/otel/tests/suite/otlp_http_loopback.rs b/codex-rs/otel/tests/suite/otlp_http_loopback.rs index 4c2dd36f7..e109672b2 100644 --- a/codex-rs/otel/tests/suite/otlp_http_loopback.rs +++ b/codex-rs/otel/tests/suite/otlp_http_loopback.rs @@ -218,7 +218,7 @@ fn otlp_http_exporter_sends_metrics_to_collector() -> Result<()> { assert!( body.contains("codex.turns"), "expected metric name not found; body prefix: {}", - &body.chars().take(2000).collect::() + body.chars().take(2000).collect::() ); Ok(()) @@ -381,17 +381,17 @@ fn otlp_http_exporter_sends_traces_to_collector() assert!( body.contains("trace-loopback"), "expected span name not found; body prefix: {}", - &body.chars().take(2000).collect::() + body.chars().take(2000).collect::() ); assert!( body.contains("codex-cli"), "expected service name not found; body prefix: {}", - &body.chars().take(2000).collect::() + body.chars().take(2000).collect::() ); assert!( body.contains("test.configured_attribute") && body.contains("configured-value"), "expected configured span attribute not found; body prefix: {}", - &body.chars().take(2000).collect::() + body.chars().take(2000).collect::() ); Ok(()) @@ -499,12 +499,12 @@ async fn otlp_http_exporter_sends_traces_to_collector_in_tokio_runtime() assert!( body.contains("trace-loopback-tokio"), "expected span name not found; body prefix: {}", - &body.chars().take(2000).collect::() + body.chars().take(2000).collect::() ); assert!( body.contains("codex-cli"), "expected service name not found; body prefix: {}", - &body.chars().take(2000).collect::() + body.chars().take(2000).collect::() ); Ok(()) @@ -631,12 +631,12 @@ fn otlp_http_exporter_sends_traces_to_collector_in_current_thread_tokio_runtime( assert!( body.contains("trace-loopback-current-thread"), "expected span name not found; body prefix: {}", - &body.chars().take(2000).collect::() + body.chars().take(2000).collect::() ); assert!( body.contains("codex-cli"), "expected service name not found; body prefix: {}", - &body.chars().take(2000).collect::() + body.chars().take(2000).collect::() ); Ok(()) diff --git a/codex-rs/response-debug-context/src/lib.rs b/codex-rs/response-debug-context/src/lib.rs index d9c186e02..490bb1c79 100644 --- a/codex-rs/response-debug-context/src/lib.rs +++ b/codex-rs/response-debug-context/src/lib.rs @@ -19,10 +19,7 @@ pub struct ResponseDebugContext { pub fn extract_response_debug_context(transport: &TransportError) -> ResponseDebugContext { let mut context = ResponseDebugContext::default(); - let TransportError::Http { - headers, body: _, .. - } = transport - else { + let TransportError::Http { headers, .. } = transport else { return context; }; diff --git a/codex-rs/rust-toolchain.toml b/codex-rs/rust-toolchain.toml index 02f4319d7..c0712851e 100644 --- a/codex-rs/rust-toolchain.toml +++ b/codex-rs/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.96.1" +channel = "1.97.0" components = ["clippy", "rustfmt", "rust-src"] diff --git a/codex-rs/shell-command/src/bash.rs b/codex-rs/shell-command/src/bash.rs index b25d3fd37..60a611048 100644 --- a/codex-rs/shell-command/src/bash.rs +++ b/codex-rs/shell-command/src/bash.rs @@ -85,11 +85,8 @@ pub fn try_parse_word_only_commands_sequence(tree: &Tree, src: &str) -> Option SelectionViewParams { "Delete", "Delete the run or mark it for deletion", agent.retention_state == AgentRetentionState::Deleted, - Some("Agent is already deleted".to_string()) - .filter(|_| agent.retention_state == AgentRetentionState::Deleted), + (agent.retention_state == AgentRetentionState::Deleted) + .then_some("Agent is already deleted".to_string()), move || AppEvent::DeleteBackgroundAgent { agent_id: Some(delete_agent_id.clone()), }, diff --git a/codex-rs/tui/src/history_cell/session.rs b/codex-rs/tui/src/history_cell/session.rs index 85e8a45f4..2c013771f 100644 --- a/codex-rs/tui/src/history_cell/session.rs +++ b/codex-rs/tui/src/history_cell/session.rs @@ -75,6 +75,9 @@ fn with_border_internal( /// Return the emoji followed by a hair space (U+200A). /// Using only the hair space avoids excessive padding after the emoji while /// still providing a small visual gap across terminals. +// Only reached through trait-object rendering paths, which rustc's dead_code +// analysis cannot trace; keep it despite the false-positive warning. +#[allow(dead_code)] pub(crate) fn padded_emoji(emoji: &str) -> String { format!("{emoji}\u{200A}") }