fix(cron): avoid marking queued announce paths as delivered (#29716)

Cron announce flow treated queued/steered outcomes as delivered even when no direct outbound send was confirmed, which could report false-positive delivery state. This change keeps cron delivery strict: only direct-path announce results count as delivered.

Closes #29660
This commit is contained in:
Sid
2026-03-01 01:09:09 +08:00
committed by GitHub
parent 3096837238
commit daa418895e
2 changed files with 37 additions and 1 deletions

View File

@@ -1346,7 +1346,17 @@ export async function runSubagentAnnounceFlow(params: {
directIdempotencyKey,
signal: params.signal,
});
didAnnounce = delivery.delivered;
// Cron delivery state should only be marked as delivered when we have a
// direct path result. Queue/steer means "accepted for later processing",
// not a confirmed channel send, and can otherwise produce false positives.
if (
announceType === "cron job" &&
(delivery.path === "queued" || delivery.path === "steered")
) {
didAnnounce = false;
} else {
didAnnounce = delivery.delivered;
}
if (!delivery.delivered && delivery.path === "direct" && delivery.error) {
defaultRuntime.error?.(
`Subagent completion direct announce failed for run ${params.childRunId}: ${delivery.error}`,