From 97255a0f5a6f0ebdd04bf026ce67647a3c165253 Mon Sep 17 00:00:00 2001 From: Xipu Li Date: Fri, 9 May 2025 10:44:02 -0700 Subject: [PATCH 1/2] fix: reset terminal attributes after adding tool results --- crates/chat-cli/src/cli/chat/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/chat-cli/src/cli/chat/mod.rs b/crates/chat-cli/src/cli/chat/mod.rs index a7937de749..505ca8665e 100644 --- a/crates/chat-cli/src/cli/chat/mod.rs +++ b/crates/chat-cli/src/cli/chat/mod.rs @@ -2865,6 +2865,12 @@ impl ChatContext { let images = image_blocks.into_iter().map(|(block, _)| block).collect(); self.conversation_state .add_tool_results_with_images(tool_results, images); + execute!( + self.output, + style::SetAttribute(Attribute::Reset), + style::SetForegroundColor(Color::Reset), + style::Print("\n") + )?; } else { self.conversation_state.add_tool_results(tool_results); } From d083cc1705a07646c3c6da00d79ac389ff6768a4 Mon Sep 17 00:00:00 2001 From: Xipu Li Date: Fri, 9 May 2025 13:16:40 -0700 Subject: [PATCH 2/2] fix: don't throw when slash file path is at the beginning of the user input --- crates/chat-cli/src/cli/chat/command.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/chat-cli/src/cli/chat/command.rs b/crates/chat-cli/src/cli/chat/command.rs index 43d07f1169..6973339591 100644 --- a/crates/chat-cli/src/cli/chat/command.rs +++ b/crates/chat-cli/src/cli/chat/command.rs @@ -810,13 +810,8 @@ impl Command { } }, "usage" => Self::Usage, - unknown_command => { - // If the command starts with a slash but isn't recognized, - // return an error instead of treating it as a prompt - return Err(format!( - "Unknown command: '/{}'. Type '/help' to see available commands.\nTo use a literal slash at the beginning of your message, escape it with a backslash (e.g., '\\//hey' for '/hey').", - unknown_command - )); + _unknown_command => Self::Ask { + prompt: input.to_string(), }, }); }