mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
fix(tui/history): clear stale mid-turn on new task
This commit is contained in:
@@ -12590,16 +12590,20 @@ impl ChatWidget<'_> {
|
||||
// due to reconnect), `active_task_ids` can stay non-empty. That makes every
|
||||
// subsequent Answer look like "mid-turn" forever and keeps the footer spinner
|
||||
// stuck.
|
||||
if let Some(last_id) = self.last_seen_answer_stream_id_in_turn.clone() {
|
||||
if self.mid_turn_answer_ids_in_turn.contains(&last_id)
|
||||
|| !self.active_task_ids.is_empty()
|
||||
{
|
||||
self.mid_turn_answer_ids_in_turn.remove(&last_id);
|
||||
self.maybe_clear_mid_turn_for_last_answer(&last_id);
|
||||
}
|
||||
}
|
||||
if !self.active_task_ids.is_empty() {
|
||||
tracing::warn!(
|
||||
"TaskStarted id={} while {} task(s) still active; assuming stale turn state",
|
||||
id,
|
||||
self.active_task_ids.len()
|
||||
);
|
||||
if let Some(last_id) = self.last_seen_answer_stream_id_in_turn.clone() {
|
||||
self.mid_turn_answer_ids_in_turn.remove(&last_id);
|
||||
self.maybe_clear_mid_turn_for_last_answer(&last_id);
|
||||
}
|
||||
self.active_task_ids.clear();
|
||||
}
|
||||
// Reset per-turn cleanup guard and clear any lingering running
|
||||
|
||||
Reference in New Issue
Block a user