Keep handoff resolution logging non-fatal

This commit is contained in:
Dotta committed 2026-05-06 06:09:30 -05:00
1 parent fdf3e92ab4
commit 39072403f1
1 file changed
+23 -19
+23 -19
View File
@@ -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)) {