feat: Enhance subagent tool output handling and clarify workflow directives
This commit is contained in:
@@ -612,8 +612,30 @@ pub fn run_subagent(ctx: &SubagentContext, tx: &mpsc::Sender<SubagentEvent>) ->
|
||||
let _ = tx.blocking_send(SubagentEvent::ToolResult {
|
||||
tool: tool_name.clone(),
|
||||
args: args.clone(),
|
||||
output: output_text,
|
||||
output: output_text.clone(),
|
||||
});
|
||||
|
||||
let is_readonly = tool_name == "read"
|
||||
|| tool_name == "view_file"
|
||||
|| tool_name == "grep"
|
||||
|| tool_name == "grep_search"
|
||||
|| tool_name == "glob"
|
||||
|| tool_name == "dir_list"
|
||||
|| tool_name == "list_dir";
|
||||
|
||||
if is_readonly {
|
||||
if let Some(ref findings) = ctx.workflow_findings {
|
||||
if let Ok(mut f) = findings.lock() {
|
||||
let args_json = serde_json::to_string(&args).unwrap_or_default();
|
||||
let mut shared_text = output_text;
|
||||
if shared_text.len() > 50_000 {
|
||||
shared_text.truncate(50_000);
|
||||
shared_text.push_str("\n...[truncated]");
|
||||
}
|
||||
f.push(format!("[Auto-Shared] Sibling drone executed '{}' with args {}:\n{}", tool_name, args_json, shared_text));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
let err_str = e.to_string();
|
||||
|
||||
Reference in New Issue
Block a user