From 8980e5ae13434b495d1ff8523083a99274eba7e6 Mon Sep 17 00:00:00 2001 From: Jayant Pranjal Date: Mon, 28 Jul 2025 16:20:46 +0530 Subject: [PATCH 1/2] feat: Support for /retry --- crates/forge_main/src/model.rs | 7 +++++++ crates/forge_main/src/ui.rs | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/crates/forge_main/src/model.rs b/crates/forge_main/src/model.rs index 5fc2de3de8..8a3da8ab5b 100644 --- a/crates/forge_main/src/model.rs +++ b/crates/forge_main/src/model.rs @@ -185,6 +185,7 @@ impl ForgeCommandManager { "/agent" => Ok(Command::Agent), "/login" => Ok(Command::Login), "/logout" => Ok(Command::Logout), + "/retry" => Ok(Command::Retry), text => { let parts = text.split_ascii_whitespace().collect::>(); @@ -280,6 +281,11 @@ pub enum Command { /// Logs out of the current session. #[strum(props(usage = "Logout of the current session"))] Logout, + + /// Retry the last command. + /// This can be triggered with the '/retry' command. + #[strum(props(usage = "Retry the last command"))] + Retry, } impl Command { @@ -302,6 +308,7 @@ impl Command { Command::Agent => "/agent", Command::Login => "/login", Command::Logout => "/logout", + Command::Retry => "/retry", } } diff --git a/crates/forge_main/src/ui.rs b/crates/forge_main/src/ui.rs index 6d69dc6a25..02f38dae36 100644 --- a/crates/forge_main/src/ui.rs +++ b/crates/forge_main/src/ui.rs @@ -451,6 +451,10 @@ impl A> UI { // Exit the UI after logout return Ok(true); } + Command::Retry => { + self.spinner.start(None)?; + self.on_message(None).await?; + } } Ok(false) From 044f6ec40646580ec2d23f1c0c82632bb0b9840d Mon Sep 17 00:00:00 2001 From: Jayant Pranjal Date: Tue, 29 Jul 2025 00:17:03 +0530 Subject: [PATCH 2/2] Update comment on crates/forge_main/src/model.rs Co-authored-by: Tushar Mathur --- crates/forge_main/src/model.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/forge_main/src/model.rs b/crates/forge_main/src/model.rs index 8a3da8ab5b..d87541e920 100644 --- a/crates/forge_main/src/model.rs +++ b/crates/forge_main/src/model.rs @@ -282,8 +282,7 @@ pub enum Command { #[strum(props(usage = "Logout of the current session"))] Logout, - /// Retry the last command. - /// This can be triggered with the '/retry' command. + /// Retry without modifying model context #[strum(props(usage = "Retry the last command"))] Retry, }