clear activity indicator on error paths
"thinking..." was getting stuck in the status bar when a turn ended with a stream error, context overflow, or model error — only the success path cleared it. Now all error returns clear the activity indicator. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
a360607fad
commit
35f231233f
1 changed files with 2 additions and 0 deletions
|
|
@ -351,11 +351,13 @@ impl Agent {
|
||||||
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
|
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
let _ = ui_tx.send(UiMessage::Activity(String::new()));
|
||||||
return Err(err);
|
return Err(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if finish_reason.as_deref() == Some("error") {
|
if finish_reason.as_deref() == Some("error") {
|
||||||
let detail = if content.is_empty() { "no details".into() } else { content };
|
let detail = if content.is_empty() { "no details".into() } else { content };
|
||||||
|
let _ = ui_tx.send(UiMessage::Activity(String::new()));
|
||||||
return Err(anyhow::anyhow!("model stream error: {}", detail));
|
return Err(anyhow::anyhow!("model stream error: {}", detail));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue