From 5c559f616a79b5bcc86b080a9cc914cace8cedef Mon Sep 17 00:00:00 2001 From: LifetimeMistake <57274704+LifetimeMistake@users.noreply.github.com> Date: Thu, 8 Aug 2024 02:13:18 +0200 Subject: fix: incorrect function call handling with session in non-REPL (#777) --- src/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3c8cf65..5c22f7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -198,8 +198,6 @@ async fn start_directive( .write() .after_chat_completion(&input, &output, &tool_results)?; - config.write().exit_session()?; - if need_send_tool_results(&tool_results) { start_directive( config, @@ -207,10 +205,11 @@ async fn start_directive( code_mode, abort_signal, ) - .await - } else { - Ok(()) + .await?; } + + config.write().exit_session()?; + Ok(()) } async fn start_interactive(config: &GlobalConfig) -> Result<()> { -- cgit v1.2.3