From c765487b6dd780d6972ff85a358835fe9cf9e3a7 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Sun, 3 May 2026 03:10:45 +0300 Subject: [PATCH] codex: fix CI failure on PR #20824 --- codex-rs/tui/src/bottom_pane/slash_commands.rs | 6 ++++++ codex-rs/tui/src/chatwidget/slash_dispatch.rs | 3 ++- codex-rs/tui/src/chatwidget/tests.rs | 2 -- codex-rs/tui/src/chatwidget/tests/helpers.rs | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/codex-rs/tui/src/bottom_pane/slash_commands.rs b/codex-rs/tui/src/bottom_pane/slash_commands.rs index a3608dff91..8a62a8e31d 100644 --- a/codex-rs/tui/src/bottom_pane/slash_commands.rs +++ b/codex-rs/tui/src/bottom_pane/slash_commands.rs @@ -54,6 +54,12 @@ pub(crate) enum SlashCommandAction { ServiceTier(ServiceTierCommand), } +impl From for SlashCommandAction { + fn from(command: SlashCommand) -> Self { + Self::Builtin(command) + } +} + pub(crate) fn command_name(action: &SlashCommandAction) -> &str { match action { SlashCommandAction::Builtin(command) => command.command(), diff --git a/codex-rs/tui/src/chatwidget/slash_dispatch.rs b/codex-rs/tui/src/chatwidget/slash_dispatch.rs index a1fe0bb66c..3be04e0788 100644 --- a/codex-rs/tui/src/chatwidget/slash_dispatch.rs +++ b/codex-rs/tui/src/chatwidget/slash_dispatch.rs @@ -111,7 +111,8 @@ impl ChatWidget { self.request_side_conversation(parent_thread_id, /*user_message*/ None); } - pub(super) fn dispatch_command(&mut self, cmd: SlashCommandAction) { + pub(super) fn dispatch_command(&mut self, cmd: impl Into) { + let cmd = cmd.into(); if !self.ensure_slash_command_allowed_in_side_conversation(&cmd) { return; } diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index 070ecfaf06..8c59dcea14 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -148,8 +148,6 @@ pub(super) use codex_protocol::approvals::GuardianUserAuthorization; pub(super) use codex_protocol::config_types::CollaborationMode; pub(super) use codex_protocol::config_types::ModeKind; pub(super) use codex_protocol::config_types::Personality; -pub(super) use codex_protocol::config_types::SERVICE_TIER_PRIORITY; -pub(super) use codex_protocol::config_types::ServiceTier; pub(super) use codex_protocol::config_types::Settings; pub(super) use codex_protocol::models::FileSystemPermissions; pub(super) use codex_protocol::models::MessagePhase; diff --git a/codex-rs/tui/src/chatwidget/tests/helpers.rs b/codex-rs/tui/src/chatwidget/tests/helpers.rs index 10a580f34c..1d6eb315b6 100644 --- a/codex-rs/tui/src/chatwidget/tests/helpers.rs +++ b/codex-rs/tui/src/chatwidget/tests/helpers.rs @@ -182,7 +182,7 @@ pub(super) async fn make_chatwidget_manual( }; let current_collaboration_mode = base_mode; let active_collaboration_mask = collaboration_modes::default_mask(model_catalog.as_ref()); - let effective_service_tier = cfg.service_tier; + let effective_service_tier = cfg.service_tier.clone(); let mut widget = ChatWidget { app_event_tx, codex_op_target: super::CodexOpTarget::Direct(op_tx),