Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions crates/forge_main/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,24 @@ impl ForgeCommandManager {
"Usage: :rename <name>. Please provide a name for the conversation."
));
}
Ok(SlashCommand::Rename(name))
}
"/delete" => Ok(SlashCommand::Delete),
Comment thread
Devthatdoes marked this conversation as resolved.
text => {
let parts = text.split_ascii_whitespace().collect::<Vec<&str>>();

if let Some(command) = parts.first() {
// Check if it's an agent command pattern (/agent-*)
if command.starts_with("/agent-") {
let command_name = command.strip_prefix('/').unwrap();
if let Some(found_command) = self.find(command_name) {
// Extract the agent ID from the command value
if let Some(agent_id) = &found_command.value {
return Ok(SlashCommand::AgentSwitch(agent_id.clone()));
}
}
return Err(anyhow::anyhow!("{command} is not a valid agent command"));
}

// Check if it's an agent command pattern (agent-*)
if command_name.starts_with("agent-") {
Expand Down
7 changes: 6 additions & 1 deletion crates/forge_main/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,12 @@ impl<A: API + ConsoleWriter + 'static, F: Fn(ForgeConfig) -> A + Send + Sync> UI
}

async fn handle_delete_conversation(&mut self) -> anyhow::Result<()> {
let conversation_id = self.init_conversation().await?;
let conversation_id = self
.state
.conversation_id
.ok_or_else(|| anyhow::anyhow!("No active conversation to delete. Start a conversation first."))?;

self.validate_conversation_exists(&conversation_id).await?;
Comment thread
Devthatdoes marked this conversation as resolved.
self.on_conversation_delete(conversation_id).await?;
Ok(())
}
Expand Down
Loading