fix: When parallel agents run, only write to stdout from the parent and only display the parent's throbber
This commit is contained in:
@@ -411,9 +411,11 @@ pub async fn call_chat_completions(
|
|||||||
client: &dyn Client,
|
client: &dyn Client,
|
||||||
abort_signal: AbortSignal,
|
abort_signal: AbortSignal,
|
||||||
) -> Result<(String, Vec<ToolResult>)> {
|
) -> Result<(String, Vec<ToolResult>)> {
|
||||||
|
let is_child_agent = client.global_config().read().current_depth > 0;
|
||||||
|
let spinner_message = if is_child_agent { "" } else { "Generating" };
|
||||||
let ret = abortable_run_with_spinner(
|
let ret = abortable_run_with_spinner(
|
||||||
client.chat_completions(input.clone()),
|
client.chat_completions(input.clone()),
|
||||||
"Generating",
|
spinner_message,
|
||||||
abort_signal,
|
abort_signal,
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|||||||
+1
-1
@@ -861,7 +861,7 @@ impl ToolCall {
|
|||||||
|
|
||||||
let prompt = format!("Call {cmd_name} {}", cmd_args.join(" "));
|
let prompt = format!("Call {cmd_name} {}", cmd_args.join(" "));
|
||||||
|
|
||||||
if *IS_STDOUT_TERMINAL {
|
if *IS_STDOUT_TERMINAL && config.read().current_depth == 0 {
|
||||||
println!("{}", dimmed_text(&prompt));
|
println!("{}", dimmed_text(&prompt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user