From 3a02b4d0a616f0527207fa8f86d0a733fd4ffb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sun, 19 Apr 2026 19:11:47 -0400 Subject: [PATCH] Stop creating plan_review approvals on every subtask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In co-founder mode, onTaskStarted created a plan_review checkpoint for every research / content / management task, including every subtask the assignee decomposed its work into. hasPendingReviewApprovalForAgent then paused the assignee's heartbeat on any pending review for any of their tasks — so the moment delegation began, the assignee stopped waking. Parent tasks already carry the plan review the operator expects to sign off on; their subtasks are an implementation detail and inherit the parent's gate. Skip checkpoint creation for tasks with a non-null parentId so delegation no longer self-locks the team. --- src/main/checkpoint-engine.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/checkpoint-engine.ts b/src/main/checkpoint-engine.ts index 06153050..7f1a93c4 100644 --- a/src/main/checkpoint-engine.ts +++ b/src/main/checkpoint-engine.ts @@ -35,8 +35,12 @@ export function createCheckpointEngine(deps: CheckpointDeps) { return { /** * Called when a task transitions to in_progress for the first time. - * In co-founder mode, creates a plan_review checkpoint for non-code tasks - * so the user can review the task plan before execution begins. + * In co-founder mode, creates a plan_review checkpoint for top-level + * non-code tasks so the user can review the plan before execution + * begins. Subtasks inherit their parent's review — creating a + * checkpoint for every subtask made the whole team stall on a + * waterfall of approvals that the operator had no chance to process + * in real time. */ onTaskStarted(taskId: string, companyId: string, agentId: string | null): string | null { try { @@ -49,6 +53,12 @@ export function createCheckpointEngine(deps: CheckpointDeps) { // Only create plan checkpoints for non-code task types if (!taskType || !CHECKPOINT_TASK_TYPES.has(taskType)) return null; + // Subtasks inherit the parent's plan review; creating a fresh + // checkpoint per subtask produces an unbounded approval fan-out + // that blocks the assignee's heartbeat (shouldPauseHeartbeat) + // the moment delegation starts. + if (task.parentId) return null; + const approvalId = db.requestApproval({ companyId, relatedTaskId: taskId,