forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
Two related bugs in commitTask (pulse.ts):
Bug 1 (#277): @ops commits in wrong directory
Session.createNext({ directory: task.worktree }) stores the worktree in the session record but the bash tool ignores it — it always uses Instance.directory (project root) as cwd. The ops prompt says 'Commit all changes in the current directory' but current directory is the main repo, not the worktree.
Bug 2 (#278): No verification that commit succeeded
After @ops session completes, commitTask unconditionally marks task as stage: done. If git reported 'nothing to commit', the task is silently closed with no commit made and all developer work is lost.
Fix
pulse.ts commitTask function only:
- Make ops prompt explicit about the worktree path and instruct @ops to use
workdir: task.worktreewhen calling bash tool - After ops session completes, read the final assistant message via
MessageV2.stream(opsSession.id)and check for commit success indicators (commit hash) vs failure ('nothing to commit', 'fatal', 'error'). Escalate on failure instead of marking done.
Acceptance Criteria
- @ops runs
git add -A && git commitin the worktree directory (not project root) - After adversarial APPROVED, a new commit appears in the worktree branch
- If git reports 'nothing to commit', task is escalated (not silently closed as done)
-
bun testandbun run typecheckpass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels