feat(subagent): emit reasoning text as progress in StepCompleted events

This commit is contained in:
asepharyana
2026-07-15 02:25:15 +07:00
parent dfceb8acac
commit 97aa75f2da
2 changed files with 32 additions and 2 deletions
+9
View File
@@ -416,6 +416,15 @@ pub fn run_subagent(ctx: &SubagentContext, tx: &mpsc::Sender<SubagentEvent>) ->
let content = response.content.clone().unwrap_or_default();
// Emit thinking/reasoning text as StepCompleted so the parent's
// drain thread can show it as progress instead of just the tool name.
if !content.is_empty() {
let _ = tx.blocking_send(SubagentEvent::StepCompleted {
step,
output: content.clone(),
});
}
if has_tool_calls {
let tool_calls = response.tool_calls.clone().unwrap_or_default();
// Push the assistant message with tool_calls into the conversation