Avoid locking source issue for recovery-action wakes

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-05-09 21:38:41 -05:00
1 parent 3bcc66500f
commit dd1b5244e5
1 file changed
+4 -2
+4 -2
View File
@@ -5883,8 +5883,10 @@ export function heartbeatService(db: Db, options: HeartbeatServiceOptions = {})
// Fix A (lazy locking): stamp executionRunId now that the run is actually running,
// not at queue time. Guard is idempotent — safe if called more than once.
const claimedIssueId = readNonEmptyString(parseObject(claimed.contextSnapshot).issueId);
if (claimedIssueId) {
const claimedContext = parseObject(claimed.contextSnapshot);
const claimedIssueId = readNonEmptyString(claimedContext.issueId);
const claimedWakeReason = readNonEmptyString(claimedContext.wakeReason);
if (claimedIssueId && claimedWakeReason !== "source_scoped_recovery_action") {
const claimedAgent = await getAgent(claimed.agentId);
await db
.update(issues)