Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions packages/opencode/src/tasks/pulse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,21 @@ async function processAdversarialVerdicts(jobId: string, projectId: string, pmSe
true,
)

// Reload to get task without the cleared verdict
const updatedTask = await Store.getTask(projectId, task.id)
if (!updatedTask) {
log.error("task disappeared after clearing verdict", { taskId: task.id })
continue
}

if (verdict.verdict === "APPROVED") {
await commitTask(task, projectId, pmSessionId)
await commitTask(updatedTask, projectId, pmSessionId)
} else {
const newAttempt = (task.pipeline.attempt || 0) + 1
const newAttempt = (updatedTask.pipeline.attempt || 0) + 1
if (newAttempt >= 3) {
await escalateToPM(task, jobId, projectId, pmSessionId)
await escalateToPM(updatedTask, jobId, projectId, pmSessionId)
} else {
await respawnDeveloper(task, jobId, projectId, pmSessionId, newAttempt, verdict)
await respawnDeveloper(updatedTask, jobId, projectId, pmSessionId, newAttempt, verdict)
}
}
}
Expand Down
Loading