summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
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<()> {