From d29b0f8f656d23624eeb4522a439cded602d1770 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 12 Sep 2026 22:02:08 -0500 Subject: [PATCH] fix: preserve explicit interaction payloads during handoff queue drain Co-Authored-By: Paperclip --- server/src/modules/wake-queue/application/use-cases.test.ts | 1 + server/src/modules/wake-queue/application/use-cases.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/modules/wake-queue/application/use-cases.test.ts b/server/src/modules/wake-queue/application/use-cases.test.ts index e5c8fae2ed..91ed298502 100644 --- a/server/src/modules/wake-queue/application/use-cases.test.ts +++ b/server/src/modules/wake-queue/application/use-cases.test.ts @@ -190,6 +190,7 @@ describe("releaseIssueExecution", () => { { agentId: ISSUE.assigneeAgentId!, wakeReason: "issue_commented", preservesIndependentContinuation: false, authorizedFailedChatRetry: false }, { agentId: "mentioned-agent", wakeReason: "issue_comment_mentioned", preservesIndependentContinuation: false, authorizedFailedChatRetry: false }, { agentId: "interaction-agent", wakeReason: "issue_commented", preservesIndependentContinuation: true, authorizedFailedChatRetry: false }, + { agentId: "interaction-payload-agent", wakeReason: "issue_commented", preservesIndependentContinuation: false, authorizedFailedChatRetry: false, payload: { mutation: "interaction" } }, { agentId: "chat-agent", wakeReason: "issue_commented", preservesIndependentContinuation: false, authorizedFailedChatRetry: true }, ])("preserves the independently authorized $agentId/$wakeReason wake", async (authority) => { const queuedCommentIds = ["saved-user-direction"]; diff --git a/server/src/modules/wake-queue/application/use-cases.ts b/server/src/modules/wake-queue/application/use-cases.ts index 434911bae7..b18377148d 100644 --- a/server/src/modules/wake-queue/application/use-cases.ts +++ b/server/src/modules/wake-queue/application/use-cases.ts @@ -167,7 +167,7 @@ async function runReleaseDrain( } processedWakeIds.add(candidate.id); - const ordinaryTaskComment = !candidate.authorizedFailedChatRetry && + const ordinaryTaskComment = !candidate.authorizedFailedChatRetry && candidate.payload.mutation !== "interaction" && !candidate.preservesIndependentContinuation && candidate.queuedCommentIds.length > 0 && ["issue_commented", "issue_reopened_via_comment"].includes(candidate.wakeReason ?? candidate.reason ?? ""); if (ordinaryTaskComment && candidate.agentId !== issue.assigneeAgentId) {