fix: Fail fast when agent worktree creation or branch setup fails
Previously, branch computation errors and ensureBranch failures were silently swallowed for all tasks, allowing execution agents to spawn without proper git isolation. This caused alert-pony to commit directly to main instead of its task branch. - manager.ts: Verify each project worktree subdirectory exists after createProjectWorktrees; throw if any are missing. Convert passive cwdVerified log to a hard guard. - dispatch/manager.ts: Make branch computation and ensureBranch errors fatal for execution tasks (execute, verify, merge, review) while keeping them non-fatal for planning tasks.
This commit is contained in:
@@ -69,6 +69,7 @@ InitiativeChangesRequestedEvent { initiativeId, phaseId, taskId }
|
||||
7. **Summary propagation** — `completeTask()` reads the completing agent's `result.message` and stores it on the task's `summary` column. Dependent tasks see this summary in `context/tasks/<id>.md` frontmatter.
|
||||
8. **Spawn failure** — If `agentManager.spawn()` throws, the task is blocked via `blockTask()` with the error message. The dispatch cycle continues instead of crashing.
|
||||
9. **Retry blocked** — `retryBlockedTask(taskId)` resets a blocked task to pending and re-queues it. Exposed via tRPC `retryBlockedTask` mutation. The UI shows a Retry button in the task slide-over when status is `blocked`.
|
||||
10. **Branch validation** — Branch computation and `ensureBranch` errors are fatal for execution tasks (execute, verify, merge, review) but non-fatal for planning tasks. This prevents agents from spawning without proper branch isolation.
|
||||
|
||||
### DispatchManager Methods
|
||||
|
||||
|
||||
Reference in New Issue
Block a user