From 38add6ebb9602310290eed529b7656f98a77ab70 Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 10 Apr 2026 11:39:54 -0500 Subject: [PATCH] fix(heartbeat): skip retries for promoted comment wakes --- .../heartbeat-comment-wake-batching.test.ts | 4 ++-- server/src/services/heartbeat.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/server/src/__tests__/heartbeat-comment-wake-batching.test.ts b/server/src/__tests__/heartbeat-comment-wake-batching.test.ts index 1a4d2f9661d..61c004486ae 100644 --- a/server/src/__tests__/heartbeat-comment-wake-batching.test.ts +++ b/server/src/__tests__/heartbeat-comment-wake-batching.test.ts @@ -262,7 +262,7 @@ describe("heartbeat comment wake batching", () => { payloadTemplate: { message: "wake now", }, - waitTimeoutMs: 2_000, + waitTimeoutMs: 10_000, }, runtimeConfig: {}, permissions: {}, @@ -455,7 +455,7 @@ describe("heartbeat comment wake batching", () => { payloadTemplate: { message: "wake now", }, - waitTimeoutMs: 2_000, + waitTimeoutMs: 10_000, }, runtimeConfig: {}, permissions: {}, diff --git a/server/src/services/heartbeat.ts b/server/src/services/heartbeat.ts index 942cf7df53e..b4b34751098 100644 --- a/server/src/services/heartbeat.ts +++ b/server/src/services/heartbeat.ts @@ -2062,6 +2062,9 @@ export function heartbeatService(db: Db) { ) { const contextSnapshot = parseObject(run.contextSnapshot); const issueId = readNonEmptyString(contextSnapshot.issueId); + const isPromotedDeferredCommentWake = + readNonEmptyString(contextSnapshot.wakeReason) === "issue_execution_promoted" && + extractWakeCommentIds(contextSnapshot).length > 0; if (!issueId) { if (run.issueCommentStatus !== "not_applicable") { await patchRunIssueCommentStatus(run.id, { @@ -2073,6 +2076,15 @@ export function heartbeatService(db: Db) { return { outcome: "not_applicable" as const, queuedRun: null }; } + if (isPromotedDeferredCommentWake) { + await patchRunIssueCommentStatus(run.id, { + issueCommentStatus: "not_applicable", + issueCommentSatisfiedByCommentId: null, + issueCommentRetryQueuedAt: null, + }); + return { outcome: "not_applicable" as const, queuedRun: null }; + } + const postedComment = await findRunIssueComment(run.id, run.companyId, issueId); if (postedComment) { await patchRunIssueCommentStatus(run.id, {