Skip to content

Commit a86137f

Browse files
committed
fix: preserve waiting subagent handoff
1 parent 92cfaf7 commit a86137f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/agent/subagent.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,20 @@ impl SubagentHarness {
616616
.store(ST_FAILED, std::sync::atomic::Ordering::Release);
617617
("failed".to_string(), None, Some(assistant_text))
618618
}
619+
Ok(super::ReasoningLoopExit::WaitingForUser { ticket_id }) => {
620+
// Keep the established parent-agent handoff contract. A subagent
621+
// caller receives this result and uses the prefix to surface the
622+
// outstanding clarification instead of treating it as an empty
623+
// successful completion.
624+
let text = format!("{}{}", super::WAITING_FOR_USER_RESULT_PREFIX, ticket_id);
625+
{
626+
let mut r = rec.result.write().await;
627+
*r = Some(text.clone());
628+
}
629+
rec.status
630+
.store(ST_COMPLETED, std::sync::atomic::Ordering::Release);
631+
("completed".to_string(), Some(text), None)
632+
}
619633
Ok(exit) => {
620634
let text = exit.assistant_text().unwrap_or_default().to_string();
621635
{

0 commit comments

Comments
 (0)