fix: preserve explicit interaction payloads during handoff queue drain

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta 2026-09-12 22:02:08 -05:00
parent 8bb2e5acd8
commit d29b0f8f65
2 changed files with 2 additions and 1 deletions

View File

@ -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"];

View File

@ -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) {