fix: Don't break from consuming subprocess output in shell tool until both streams are done (#2771)
Co-authored-by: Max Novich <maksymstepanenko1990@gmail.com>
This commit is contained in:
@@ -727,7 +727,6 @@ impl Session {
|
||||
loop {
|
||||
tokio::select! {
|
||||
result = stream.next() => {
|
||||
let _ = progress_bars.hide();
|
||||
match result {
|
||||
Some(Ok(AgentEvent::Message(message))) => {
|
||||
// If it's a confirmation request, get approval but otherwise do not render/persist
|
||||
@@ -865,6 +864,7 @@ impl Session {
|
||||
session::persist_messages(&self.session_file, &self.messages, None).await?;
|
||||
|
||||
if interactive {output::hide_thinking()};
|
||||
let _ = progress_bars.hide();
|
||||
output::render_message(&message, self.debug);
|
||||
if interactive {output::show_thinking()};
|
||||
}
|
||||
@@ -891,7 +891,6 @@ impl Session {
|
||||
v.to_string()
|
||||
},
|
||||
};
|
||||
// output::render_text_no_newlines(&message, None, true);
|
||||
progress_bars.log(&message);
|
||||
},
|
||||
"notifications/progress" => {
|
||||
|
||||
@@ -660,6 +660,12 @@ impl McpSpinners {
|
||||
}
|
||||
|
||||
pub fn hide(&mut self) -> Result<(), Error> {
|
||||
self.bars.iter_mut().for_each(|(_, bar)| {
|
||||
bar.disable_steady_tick();
|
||||
});
|
||||
if let Some(spinner) = self.log_spinner.as_mut() {
|
||||
spinner.disable_steady_tick();
|
||||
}
|
||||
self.multi_bar.clear()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user