diff options
| author | LifetimeMistake <57274704+LifetimeMistake@users.noreply.github.com> | 2024-08-08 02:13:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-08 08:13:18 +0800 |
| commit | 5c559f616a79b5bcc86b080a9cc914cace8cedef (patch) | |
| tree | 78289064fc026c90071c5a1c09ec1445c48f1364 | |
| parent | 514a3689e8588921e0148059967dcf2aa7282747 (diff) | |
| download | aichat-5c559f616a79b5bcc86b080a9cc914cace8cedef.tar.gz | |
fix: incorrect function call handling with session in non-REPL (#777)
| -rw-r--r-- | src/main.rs | 9 |
1 files 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<()> { |
