fix-wg-done-2

Fix wg done: detect 'nothing added to commit' when squash-merge produces no changes

Metadata

Statusdone
Assignedagent-160
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-26T23:01:20.626338523+00:00
Started2026-04-26T23:03:53.295109366+00:00
Completed2026-04-26T23:41:29.757017215+00:00
Tagseval-scheduled
Eval score0.91
└ blocking impact0.90
└ completeness0.95
└ coordination overhead0.90
└ correctness0.95
└ downstream usability0.85
└ efficiency0.85
└ intent fidelity0.79
└ style adherence0.90

Description

Description

In src/commands/done.rs:222-228, the squash-merge commit step bails with "git commit failed" whenever the branch is already merged into main (e.g. on retry). The detection only checks for the literal substring "nothing to commit", but git commit actually emits "nothing added to commit but untracked files present" when there are untracked files (which happens in this repo because of stray .workgraph.* and .wg/ dirs).

This blocks wg done retries entirely after a previously-successful merge, even though the work is already on main. Encountered while completing migrate-manual-wg — the squash-merge commit (61106f20d) was already on main from a prior attempt, but every subsequent wg done call reported "git commit failed" because the message format did not match.

File scope: src/commands/done.rs

Validation

  • Failing test written first: test_done_handles_already_merged_branch — invoke wg done twice and verify the second call returns NoCommits
  • Broaden the substring check at done.rs:225 to also accept "nothing added to commit" and "no changes added to commit" (or detect by git diff --cached --quiet before invoking commit)
  • cargo build + cargo test pass

Implement directly — do not decompose further.

Depends on

Required by

Log