Skip to content

Commit 405e1db

Browse files
fix(server): a delegated child's monitor ending wakes its parent
A delegated child woken by a monitor's terminal notification (completed, failed, cancelled, unknown) answered without starting a subagent follow-up, so its new result never reached the parent. Monitor notifications now gate on outcome: only "updated" progress events skip the follow-up, matching how a background command's ending wake works. AI-assisted; verified with the tests and tools listed above.
1 parent 1dc0530 commit 405e1db

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,17 @@ function cancelledAppOwnedTask(
695695
};
696696
}
697697

698-
// Provider wakes can start follow-up work; monitor updates only report progress.
698+
// Provider wakes and monitor ends can start follow-up work; monitor updates only report progress.
699699
// Dispatch takes the parent's lock for follow-ups because intake writes the parent.
700700
function mayStartSubagentFollowup(
701701
command: Extract<OrchestrationV2Command, { readonly type: "message.dispatch" }>,
702702
): boolean {
703703
if (command.scheduledTaskId !== undefined || command.restartContinuationOfRunId !== undefined)
704704
return false;
705-
if (command.notification !== undefined) return command.notification.source.kind !== "monitor";
705+
if (command.notification !== undefined)
706+
return (
707+
command.notification.source.kind !== "monitor" || command.notification.outcome !== "updated"
708+
);
706709
return (
707710
command.createdBy === "user" ||
708711
command.creationSource === "mcp" ||

0 commit comments

Comments
 (0)