-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Two related bugs in pulse.ts + worktree/index.ts
Bug 1 (#282): Commits land on dev branch instead of feature branch
Root cause (worktree/index.ts lines 345, 359):
git worktree add --no-checkout -b ${info.branch} ${info.directory}
// then later:
git reset --hard // resets to HEAD but stays on dev — never checks out the new branch--no-checkout + git reset --hard leaves the worktree on dev HEAD. The branch opencode/<slug> is created but never checked out. Commits go to dev.
Fix: After git reset --hard, add git checkout ${info.branch} (or use git checkout -b ${info.branch} without --no-checkout).
Bug 2 (#281): Dependent task stays stuck open/idle after deps close
Root cause (pulse.ts):
After commitTask() closes a task and publishes BackgroundTaskEvent.Completed, the Pulse loop still waits up to 5 seconds before calling scheduleReadyTasks() again. In practice, the next tick never reschedules the dependent task — likely because inProgressCount is miscounted or the tick fires before the DB write is visible.
Fix: After commitTask() successfully closes a task, immediately call scheduleReadyTasks() inline rather than waiting for the next Pulse tick.
Acceptance Criteria
- After adversarial APPROVED + @ops commit, git log shows commit on
opencode/<task-slug>branch, NOTdev - After a task closes, dependent tasks are scheduled within one Pulse tick (≤5s)
-
bun testandbun run typecheckpass - Existing pulse/worktree tests updated to cover these scenarios