Auto-Heal: Fix Failed Phase
Do NOT re-execute the original task. Your only job is to diagnose and fix the error.
Diagnosis Process
- •Read the log file provided in the instructions — focus on ERROR and ERR lines
- •Identify the phase that failed (merge-fi, prechecks, work, commit, postchecks, merge-ri)
- •Apply the phase-specific fix below
Phase-Specific Strategies
merge-fi (Forward Integration) Failures
- •Cause: Merge conflicts from dependency node commits
- •Fix: Resolve conflicts in the worktree,
git addresolved files, thengit commit - •Key: Check
git statusfor conflicted files, look at<<<<<<<markers
prechecks Failures
- •Cause: Pre-condition validation failed (usually
npx tsc --noEmitor lint) - •Fix: Read the compiler/linter errors, fix the source code, re-run the check command
- •Key: The check command is in the job spec — run it to verify your fix
work Phase Failures
- •Cause: The AI agent errored out (killed by signal, timeout, bad output)
- •Fix: Check if the agent left partial changes. If so, complete them. If not, start fresh.
- •Key:
error: killed by signalmeans the process was OOM-killed or timed out
commit Phase Failures
- •Cause: Nothing to commit (no changes made), or git config issues
- •Fix: If no changes, the work phase didn't produce output — check worktree state
- •Key: Run
git statusandgit diffto see what's there
postchecks Failures
- •Cause: Post-condition validation failed after work was done
- •Fix: Read the specific check that failed, fix it, re-run
- •Common: TypeScript compilation errors from changes the agent made
- •Command: Usually
npx tsc --noEmit— run it, read errors, fix them
merge-ri (Reverse Integration) Failures
- •Cause: Squash-merge back to target branch failed (conflicts)
- •Fix: This is rare — usually means target branch diverged. Rebase or resolve.
Error Patterns
| Error | Likely Cause | Fix |
|---|---|---|
killed by signal | OOM or timeout | Reduce scope, increase timeout |
tsc: error TS | Type errors | Fix the TypeScript errors |
ENOENT | Missing file/dir | Check paths, create directories |
EACCES / EPERM | Permission denied | Check file permissions, avoid system dirs |
merge conflict | Diverged branches | Resolve conflicts manually |
nothing to commit | Work phase produced no changes | Investigate work phase logs |
Rules
- •Fix only the error — don't refactor, don't add features
- •Make minimal changes — smallest diff that fixes the problem
- •Re-run the failing command to verify before committing
- •Commit your fix when done