fix: ctrl-c interruption doesn't discard session messages when throbber is showing
CI / All (ubuntu-latest) (push) Failing after 27s
CI / All (macos-latest) (push) Has been cancelled
CI / All (windows-latest) (push) Has been cancelled

This commit is contained in:
2026-07-30 13:38:37 -06:00
parent 0324436114
commit 69e1b98c44
+10 -1
View File
@@ -505,10 +505,19 @@ pub async fn call_chat_completions_streaming(
let (text, tool_calls, thinking) = handler.take();
if aborted_ctrlc {
if text.is_empty() || !ctx.working_mode.is_repl() || ctx.session.is_none() {
if !ctx.working_mode.is_repl() || ctx.session.is_none() {
bail!("Aborted.");
}
if text.is_empty() {
if !silent && *IS_STDOUT_TERMINAL {
println!();
eprintln!("{}", error_text("Response interrupted"));
}
return Ok(("".to_string(), vec![]));
}
if !silent && *IS_STDOUT_TERMINAL {
println!();
eprintln!("{}", error_text("Response interrupted"));