From 39072403f140fe3c755544e9682f27942e0c7c82 Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 5 May 2026 12:16:30 -0500 Subject: [PATCH] Keep handoff resolution logging non-fatal --- server/src/routes/issues.ts | 42 ++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/server/src/routes/issues.ts b/server/src/routes/issues.ts index 10eeb2eafa1..4a2987804bc 100644 --- a/server/src/routes/issues.ts +++ b/server/src/routes/issues.ts @@ -2549,26 +2549,30 @@ export function issueRoutes( }); if (existing.status === "in_progress" && issue.status !== existing.status && issue.status !== "in_progress") { - const handoffStates = await listSuccessfulRunHandoffStates(db, issue.companyId, [issue.id]); - const handoff = handoffStates.get(issue.id); - if (handoff?.state === "required") { - await logActivity(db, { - companyId: issue.companyId, - actorType: actor.actorType, - actorId: actor.actorId, - agentId: actor.agentId, - runId: actor.runId, - action: "issue.successful_run_handoff_resolved", - entityType: "issue", - entityId: issue.id, - details: { - identifier: issue.identifier, - sourceRunId: handoff.sourceRunId, - correctiveRunId: handoff.correctiveRunId, - resolvedByStatus: issue.status, - }, + await listSuccessfulRunHandoffStates(db, issue.companyId, [issue.id]) + .then(async (handoffStates) => { + const handoff = handoffStates.get(issue.id); + if (handoff?.state !== "required") return; + await logActivity(db, { + companyId: issue.companyId, + actorType: actor.actorType, + actorId: actor.actorId, + agentId: actor.agentId, + runId: actor.runId, + action: "issue.successful_run_handoff_resolved", + entityType: "issue", + entityId: issue.id, + details: { + identifier: issue.identifier, + sourceRunId: handoff.sourceRunId, + correctiveRunId: handoff.correctiveRunId, + resolvedByStatus: issue.status, + }, + }); + }) + .catch((err) => { + logger.warn({ err, issueId: issue.id }, "failed to log successful run handoff resolution"); }); - } } if (Array.isArray(req.body.blockedByIssueIds)) {