From 7a8407bbb6c8802d334cc330fbcdf38cde2eed3f Mon Sep 17 00:00:00 2001 From: jif-oai Date: Mon, 22 Dec 2025 09:53:03 +0100 Subject: [PATCH] chore: un-ship undo (#8424) --- codex-rs/core/src/features.rs | 2 +- codex-rs/tui/src/chatwidget.rs | 6 +++--- codex-rs/tui/src/chatwidget/tests.rs | 12 ------------ codex-rs/tui/src/slash_command.rs | 6 +++--- codex-rs/tui2/src/chatwidget.rs | 6 +++--- codex-rs/tui2/src/chatwidget/tests.rs | 12 ------------ codex-rs/tui2/src/slash_command.rs | 6 +++--- 7 files changed, 13 insertions(+), 37 deletions(-) diff --git a/codex-rs/core/src/features.rs b/codex-rs/core/src/features.rs index 443d9a87e..5015e5f72 100644 --- a/codex-rs/core/src/features.rs +++ b/codex-rs/core/src/features.rs @@ -291,7 +291,7 @@ pub const FEATURES: &[FeatureSpec] = &[ id: Feature::GhostCommit, key: "undo", stage: Stage::Stable, - default_enabled: true, + default_enabled: false, }, FeatureSpec { id: Feature::ParallelToolCalls, diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 5b0037a2c..f0afed3bf 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -1717,9 +1717,9 @@ impl ChatWidget { } self.request_exit(); } - SlashCommand::Undo => { - self.app_event_tx.send(AppEvent::CodexOp(Op::Undo)); - } + // SlashCommand::Undo => { + // self.app_event_tx.send(AppEvent::CodexOp(Op::Undo)); + // } SlashCommand::Diff => { self.add_diff_in_progress(); let tx = self.app_event_tx.clone(); diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index c991c8404..5e595d330 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -1454,18 +1454,6 @@ async fn slash_resume_opens_picker() { assert_matches!(rx.try_recv(), Ok(AppEvent::OpenResumePicker)); } -#[tokio::test] -async fn slash_undo_sends_op() { - let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await; - - chat.dispatch_command(SlashCommand::Undo); - - match rx.try_recv() { - Ok(AppEvent::CodexOp(Op::Undo)) => {} - other => panic!("expected AppEvent::CodexOp(Op::Undo), got {other:?}"), - } -} - #[tokio::test] async fn slash_rollout_displays_current_path() { let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await; diff --git a/codex-rs/tui/src/slash_command.rs b/codex-rs/tui/src/slash_command.rs index 220dc36b5..c6bd8a771 100644 --- a/codex-rs/tui/src/slash_command.rs +++ b/codex-rs/tui/src/slash_command.rs @@ -21,7 +21,7 @@ pub enum SlashCommand { Resume, Init, Compact, - Undo, + // Undo, Diff, Mention, Status, @@ -45,7 +45,7 @@ impl SlashCommand { SlashCommand::Compact => "summarize conversation to prevent hitting the context limit", SlashCommand::Review => "review my current changes and find issues", SlashCommand::Resume => "resume a saved chat", - SlashCommand::Undo => "ask Codex to undo a turn", + // SlashCommand::Undo => "ask Codex to undo a turn", SlashCommand::Quit | SlashCommand::Exit => "exit Codex", SlashCommand::Diff => "show git diff (including untracked files)", SlashCommand::Mention => "mention a file", @@ -75,7 +75,7 @@ impl SlashCommand { | SlashCommand::Resume | SlashCommand::Init | SlashCommand::Compact - | SlashCommand::Undo + // | SlashCommand::Undo | SlashCommand::Model | SlashCommand::Approvals | SlashCommand::Experimental diff --git a/codex-rs/tui2/src/chatwidget.rs b/codex-rs/tui2/src/chatwidget.rs index f7e1d2677..b128efab6 100644 --- a/codex-rs/tui2/src/chatwidget.rs +++ b/codex-rs/tui2/src/chatwidget.rs @@ -1581,9 +1581,9 @@ impl ChatWidget { } self.request_exit(); } - SlashCommand::Undo => { - self.app_event_tx.send(AppEvent::CodexOp(Op::Undo)); - } + // SlashCommand::Undo => { + // self.app_event_tx.send(AppEvent::CodexOp(Op::Undo)); + // } SlashCommand::Diff => { self.add_diff_in_progress(); let tx = self.app_event_tx.clone(); diff --git a/codex-rs/tui2/src/chatwidget/tests.rs b/codex-rs/tui2/src/chatwidget/tests.rs index 7149d2a58..ff6b79b89 100644 --- a/codex-rs/tui2/src/chatwidget/tests.rs +++ b/codex-rs/tui2/src/chatwidget/tests.rs @@ -1290,18 +1290,6 @@ async fn slash_resume_opens_picker() { assert_matches!(rx.try_recv(), Ok(AppEvent::OpenResumePicker)); } -#[tokio::test] -async fn slash_undo_sends_op() { - let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await; - - chat.dispatch_command(SlashCommand::Undo); - - match rx.try_recv() { - Ok(AppEvent::CodexOp(Op::Undo)) => {} - other => panic!("expected AppEvent::CodexOp(Op::Undo), got {other:?}"), - } -} - #[tokio::test] async fn slash_rollout_displays_current_path() { let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await; diff --git a/codex-rs/tui2/src/slash_command.rs b/codex-rs/tui2/src/slash_command.rs index e0c676812..8fe5de766 100644 --- a/codex-rs/tui2/src/slash_command.rs +++ b/codex-rs/tui2/src/slash_command.rs @@ -20,7 +20,7 @@ pub enum SlashCommand { Resume, Init, Compact, - Undo, + // Undo, Diff, Mention, Status, @@ -43,7 +43,7 @@ impl SlashCommand { SlashCommand::Compact => "summarize conversation to prevent hitting the context limit", SlashCommand::Review => "review my current changes and find issues", SlashCommand::Resume => "resume a saved chat", - SlashCommand::Undo => "ask Codex to undo a turn", + // SlashCommand::Undo => "ask Codex to undo a turn", SlashCommand::Quit | SlashCommand::Exit => "exit Codex", SlashCommand::Diff => "show git diff (including untracked files)", SlashCommand::Mention => "mention a file", @@ -71,7 +71,7 @@ impl SlashCommand { | SlashCommand::Resume | SlashCommand::Init | SlashCommand::Compact - | SlashCommand::Undo + // | SlashCommand::Undo | SlashCommand::Model | SlashCommand::Approvals | SlashCommand::Review