fix(heartbeat): skip retries for promoted comment wakes

This commit is contained in:
Dotta committed 2026-04-10 11:39:54 -05:00
1 parent 783e9727c4
commit 38add6ebb9
2 files changed
+14 -2

No files matched your search

@@ -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: {},
+12
View File
@@ -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, {