mirror of
https://github.com/openai/codex.git
synced 2026-11-06 08:31:30 +00:00
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`
This commit is contained in:
1 parent
ed6d73b3b9
commit
7c3cc1db81
2 files changed
+11
-13
No files matched your search
@@ -12,7 +12,6 @@ use codex_extension_api::ToolCallOutcome;
|
|||||||
use codex_extension_api::ToolCallSource;
|
use codex_extension_api::ToolCallSource;
|
||||||
use codex_extension_api::ToolExecutor;
|
use codex_extension_api::ToolExecutor;
|
||||||
use codex_extension_api::ToolFinishInput;
|
use codex_extension_api::ToolFinishInput;
|
||||||
use codex_extension_api::ToolName;
|
|
||||||
use codex_extension_api::ToolPayload;
|
use codex_extension_api::ToolPayload;
|
||||||
use codex_extension_api::TurnStartInput;
|
use codex_extension_api::TurnStartInput;
|
||||||
use codex_extension_api::TurnStopInput;
|
use codex_extension_api::TurnStopInput;
|
||||||
@@ -27,6 +26,7 @@ use codex_protocol::protocol::SessionSource;
|
|||||||
use codex_protocol::protocol::ThreadGoalStatus;
|
use codex_protocol::protocol::ThreadGoalStatus;
|
||||||
use codex_protocol::protocol::TokenUsage;
|
use codex_protocol::protocol::TokenUsage;
|
||||||
use codex_protocol::protocol::TokenUsageInfo;
|
use codex_protocol::protocol::TokenUsageInfo;
|
||||||
|
use codex_protocol::protocol::TruncationPolicy;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use tempfile::TempDir;
|
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 tools = installed_tools(runtime.clone(), thread_id).await;
|
||||||
|
|
||||||
let create_tool = tool_by_name(&tools, "create_goal");
|
let create_tool = tool_by_name(&tools, "create_goal");
|
||||||
let invocation = ToolCall {
|
let invocation = tool_call(
|
||||||
call_id: "call-create-goal".to_string(),
|
"create_goal",
|
||||||
tool_name: ToolName::plain("create_goal"),
|
"call-create-goal",
|
||||||
payload: ToolPayload::Function {
|
json!({
|
||||||
arguments: json!({
|
"objective": "ship goal extension backend",
|
||||||
"objective": "ship goal extension backend",
|
"token_budget": 123,
|
||||||
"token_budget": 123,
|
}),
|
||||||
})
|
);
|
||||||
.to_string(),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
let output = create_tool.handle(invocation.clone()).await?;
|
let output = create_tool.handle(invocation.clone()).await?;
|
||||||
let result = output.code_mode_result(&invocation.payload);
|
let result = output.code_mode_result(&invocation.payload);
|
||||||
assert_eq!(
|
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 {
|
fn tool_call(tool_name: &str, call_id: &str, arguments: serde_json::Value) -> ToolCall {
|
||||||
ToolCall {
|
ToolCall {
|
||||||
|
turn_id: "turn-1".to_string(),
|
||||||
call_id: call_id.to_string(),
|
call_id: call_id.to_string(),
|
||||||
tool_name: codex_extension_api::ToolName::plain(tool_name),
|
tool_name: codex_extension_api::ToolName::plain(tool_name),
|
||||||
|
truncation_policy: TruncationPolicy::Bytes(1024),
|
||||||
payload: ToolPayload::Function {
|
payload: ToolPayload::Function {
|
||||||
arguments: arguments.to_string(),
|
arguments: arguments.to_string(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ impl ChatWidget {
|
|||||||
| ServerNotification::AccountRateLimitsUpdated(_)
|
| ServerNotification::AccountRateLimitsUpdated(_)
|
||||||
| ServerNotification::ThreadStarted(_)
|
| ServerNotification::ThreadStarted(_)
|
||||||
| ServerNotification::ThreadStatusChanged(_)
|
| ServerNotification::ThreadStatusChanged(_)
|
||||||
| ServerNotification::ThreadSettingsUpdated(_)
|
|
||||||
| ServerNotification::ThreadArchived(_)
|
| ServerNotification::ThreadArchived(_)
|
||||||
| ServerNotification::ThreadUnarchived(_)
|
| ServerNotification::ThreadUnarchived(_)
|
||||||
| ServerNotification::RawResponseItemCompleted(_)
|
| ServerNotification::RawResponseItemCompleted(_)
|
||||||
|
|||||||
Reference in new issue
Block a user