From 5a26c59a12e25cc96c6eb44c64395e673207135c Mon Sep 17 00:00:00 2001 From: sigoden Date: Fri, 13 Sep 2024 22:12:36 +0800 Subject: refactor: role/session/agent should not inherit the global `use_tools` (#868) --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 485b05d..b4b76b6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -233,6 +233,9 @@ async fn shell_execute(config: &GlobalConfig, shell: &Shell, mut input: Input) - config .write() .after_chat_completion(&input, &eval_str, &[])?; + if eval_str.is_empty() { + bail!("No command generated"); + } if config.read().dry_run { config.read().print_markdown(&eval_str)?; return Ok(()); -- cgit v1.2.3