From 55e9e07f922bd2a0920f9ab5886a4053efd5dbf7 Mon Sep 17 00:00:00 2001 From: Dotta Date: Thu, 8 Oct 2026 20:07:30 -0500 Subject: [PATCH] Use internal task authorization for committed reply recovery --- server/src/services/native-runtime/native-run-finalizer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/services/native-runtime/native-run-finalizer.ts b/server/src/services/native-runtime/native-run-finalizer.ts index 9d8c3f085d7..19d97de8c25 100644 --- a/server/src/services/native-runtime/native-run-finalizer.ts +++ b/server/src/services/native-runtime/native-run-finalizer.ts @@ -965,7 +965,7 @@ export async function repairCommittedNativeChatResponse( terminal.runTerminalState === "succeeded" && terminal.turnTerminalState === "completed" && terminal.reportedWorkDisposition === "done" && - (await resolveChatRunPresentationAuthorizationReason(tx, input)) === null + (await resolveChatRunPresentationAuthorizationReason(tx, input)) === "internal_agent_write" ) { const rows = await tx.select({ seq: heartbeatRunEvents.seq, payload: heartbeatRunEvents.payload }) .from(heartbeatRunEvents).where(and( @@ -996,7 +996,8 @@ export async function repairCommittedNativeChatResponse( }); if (!resolved.text || resolved.decision.commentAction !== "create") return false; const comment = await issueService(db).addComment(input.issueId, resolved.text, - { agentId: run.agentId, runId: run.id }, { completionReply: true }, tx); + { agentId: run.agentId, runId: run.id }, + { authorizationReason: "internal_agent_write", completionReply: true }, tx); await tx.update(heartbeatRuns).set({ resultJson: sql`coalesce(${heartbeatRuns.resultJson}, '{}'::jsonb) || ${JSON.stringify({ presentationDecision: { ...resolved.decision, commentId: comment.id,