From 7c3cc1db81a46a4f3ceeca1d7d50df0f7d10d09c Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 20 May 2026 11:58:23 -0700 Subject: [PATCH] Fix thread settings clippy failure (#23724) ## Why `main` picked up two small Rust build failures after nearby merges: - #23507 added a real handler for `ServerNotification::ThreadSettingsUpdated`, but the same variant was still listed in the ignored-notification match arm. Full Clippy runs treat the resulting unreachable-pattern warning as an error. - #23666 added `turn_id` and `truncation_policy` to `codex_tools::ToolCall`, while the goal extension backend test fixtures from the goal-extension work still used the old shape. That left `codex-goal-extension` tests unable to compile once the branches met on `main`. ## What changed Removed the duplicate `ThreadSettingsUpdated` match pattern from `tui/src/chatwidget/protocol.rs`. Updated the goal extension test `tool_call` helper to populate the new `ToolCall` fields, and reused that helper for the one direct literal that still had the old field list. ## Verification - `just fix -p codex-tui` - `cargo test -p codex-goal-extension` --- .../ext/goal/tests/goal_extension_backend.rs | 23 +++++++++---------- codex-rs/tui/src/chatwidget/protocol.rs | 1 - 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/codex-rs/ext/goal/tests/goal_extension_backend.rs b/codex-rs/ext/goal/tests/goal_extension_backend.rs index d04dbe6021..c2c0a2306c 100644 --- a/codex-rs/ext/goal/tests/goal_extension_backend.rs +++ b/codex-rs/ext/goal/tests/goal_extension_backend.rs @@ -12,7 +12,6 @@ use codex_extension_api::ToolCallOutcome; use codex_extension_api::ToolCallSource; use codex_extension_api::ToolExecutor; use codex_extension_api::ToolFinishInput; -use codex_extension_api::ToolName; use codex_extension_api::ToolPayload; use codex_extension_api::TurnStartInput; use codex_extension_api::TurnStopInput; @@ -27,6 +26,7 @@ use codex_protocol::protocol::SessionSource; use codex_protocol::protocol::ThreadGoalStatus; use codex_protocol::protocol::TokenUsage; use codex_protocol::protocol::TokenUsageInfo; +use codex_protocol::protocol::TruncationPolicy; use pretty_assertions::assert_eq; use serde_json::json; use tempfile::TempDir; @@ -39,17 +39,14 @@ async fn installed_goal_tools_create_goal_and_fill_empty_preview() -> anyhow::Re let tools = installed_tools(runtime.clone(), thread_id).await; let create_tool = tool_by_name(&tools, "create_goal"); - let invocation = ToolCall { - call_id: "call-create-goal".to_string(), - tool_name: ToolName::plain("create_goal"), - payload: ToolPayload::Function { - arguments: json!({ - "objective": "ship goal extension backend", - "token_budget": 123, - }) - .to_string(), - }, - }; + let invocation = tool_call( + "create_goal", + "call-create-goal", + json!({ + "objective": "ship goal extension backend", + "token_budget": 123, + }), + ); let output = create_tool.handle(invocation.clone()).await?; let result = output.code_mode_result(&invocation.payload); assert_eq!( @@ -534,8 +531,10 @@ fn tool_by_name<'a>( fn tool_call(tool_name: &str, call_id: &str, arguments: serde_json::Value) -> ToolCall { ToolCall { + turn_id: "turn-1".to_string(), call_id: call_id.to_string(), tool_name: codex_extension_api::ToolName::plain(tool_name), + truncation_policy: TruncationPolicy::Bytes(1024), payload: ToolPayload::Function { arguments: arguments.to_string(), }, diff --git a/codex-rs/tui/src/chatwidget/protocol.rs b/codex-rs/tui/src/chatwidget/protocol.rs index 6a980e347c..b3b58cbc82 100644 --- a/codex-rs/tui/src/chatwidget/protocol.rs +++ b/codex-rs/tui/src/chatwidget/protocol.rs @@ -220,7 +220,6 @@ impl ChatWidget { | ServerNotification::AccountRateLimitsUpdated(_) | ServerNotification::ThreadStarted(_) | ServerNotification::ThreadStatusChanged(_) - | ServerNotification::ThreadSettingsUpdated(_) | ServerNotification::ThreadArchived(_) | ServerNotification::ThreadUnarchived(_) | ServerNotification::RawResponseItemCompleted(_)