- Fix rollback to handle partial branch creation (skills-yylq)
- Pre-compute branch/worktree names before createWorktree
- Use gitBranchExists() and dirExists() for robust cleanup
- Add step context to error messages (skills-ux6h)
- Track currentStep through spawn process
- Error now shows which step failed
- Deduplicate success output block (skills-qjln)
- Consolidated to single block with conditional review line
- Simplify use-skills.sh auth symlink (skills-475o)
- One-liner with || instead of nested if
- Fix inconsistent default branch in git.nim (skills-fext)
- Changed default from "origin/integration" to "main"
Closes skills-yylq, skills-ux6h, skills-qjln, skills-475o, skills-fext
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change default base branch from origin/integration to main
- Add --noFetch flag to skip git fetch (for offline/sandbox use)
- Add try/except with rollback on spawn failure
- Improve error message for missing review-gate
- Add Codex auth.json symlink to use-skills.sh
- Include worker orchestration AAR from 2026-01-13
Addresses pain points from worker-orchestration-aar-2026-01-13.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract renderStatusTable() from nested proc in status()
- Add column width constants (ColTask, ColState, etc.)
- Use parseEnum for heartbeat status instead of case statement
- Return bool from startGlobalHeartbeat() to indicate if started
- Remove unused getBranchStatus() function (dead code)
Closes: skills-y76g, skills-f8yd, skills-audh, skills-hx1n, skills-827e
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add try/except blocks in worker commands to catch WorkerNotFound,
InvalidTransition, and StaleState exceptions
- Return ExitInvalidTransition (3) for state transition errors
- Return ExitNotFound (7) for missing workers
- Fix double ROLLBACK bug in state.nim by removing inline ROLLBACKs
and letting the except block handle transaction cleanup
Closes: skills-lxb9
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test infrastructure:
- Add comprehensive test-worker.sh with 59 tests
- Cover spawn, start, done, approve, reject, cancel, fail, heartbeat
- Test status filtering, context files, review-gate integration
- Test invalid state transitions and error cases
Bug fixes:
- Fix agent commands failing when run from worktrees (skills-y3f2)
- Add getMainRepoBusDbPath() to find DB in main repo
- Update start, done, fail, heartbeat to use correct path
- Fix review.nim crash when review-gate not installed (OSError)
- Gracefully return exitCode=-1 instead of crashing
Closes skills-y3f2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
worker.nim:
- Start heartbeat before state transition in start command
(prevents WORKING state without heartbeat if startup fails)
context.nim:
- Reject symlinks when reading context file (security)
(prevents reading arbitrary files via symlinked .worker-ctx.json)
git.nim:
- Use case-insensitive conflict detection in rebase/merge
(toLowerAscii instead of checking "CONFLICT" and "conflict" separately)
Closes: skills-qekj, skills-16zf, skills-n3qp
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
types.nim:
- Remove unused constants: BusJsonlPath, BlobsDir, WorkersDir
worker.nim:
- Remove unused 'by' and 'comment' parameters from approve()
Note: skills-5ax (unused imports in db.nim) no longer applies -
strutils is used for toHex in genOid fallback path.
Closes: skills-t9ub, skills-5ax, skills-fdu, skills-ghlb
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add branchName() and worktreePath() helpers for consistent path generation
- Add msToTime() for epoch ms to Time conversion (8 occurrences consolidated)
- Add validateTaskId() for CLI input validation (prevents path traversal)
- Add optString/optInt64 helpers for nullable DB values
- Add withTransaction template for automatic rollback on error
Closes: skills-lzh2, skills-3d9o, skills-5x2o, skills-qiq0, skills-73yu, skills-vuj2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>