mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 12:37:55 +01:00
Avoid locking source issue for recovery-action wakes
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
3bcc66500f
commit
dd1b5244e5
1 file changed
+4
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user