diff --git a/crates/forge_main/src/model.rs b/crates/forge_main/src/model.rs index 5fc2de3de8..d87541e920 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,10 @@ pub enum Command { /// Logs out of the current session. #[strum(props(usage = "Logout of the current session"))] Logout, + + /// Retry without modifying model context + #[strum(props(usage = "Retry the last command"))] + Retry, } impl Command { @@ -302,6 +307,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)