This commit is contained in:
Ahmed Ibrahim
2025-07-30 16:14:19 -07:00
parent 00fba9047c
commit c85369db78
2 changed files with 6 additions and 4 deletions

View File

@@ -895,9 +895,11 @@ async fn submission_loop(
// Attempt to inject input into current task
if let Err(items) = sess.inject_input(summarization_prompt) {
// No current task, spawn a new one
let task = AgentTask::spawn(sess.clone(), sub.id, items);
sess.set_task(task);
run_task(sess.clone(), sub.id, items).await;
// only keep the last input item and clear the rest
let mut pending_input = sess.state.lock().unwrap().pending_input.clone();
pending_input.truncate(1);
sess.state.lock().unwrap().pending_input = pending_input;
}
}
Op::Shutdown => {

View File

@@ -158,7 +158,7 @@ impl ChatWidget<'_> {
self.bottom_pane.handle_paste(text);
}
fn add_to_history(&mut self, cell: HistoryCell) {
pub(crate) fn add_to_history(&mut self, cell: HistoryCell) {
self.app_event_tx
.send(AppEvent::InsertHistory(cell.plain_lines()));
}