worktree finish: exit 1 on merge conflicts leaves no merge to resolve #1154

Open
opened 2026-10-19 12:33:29 +00:00 by jared · 3 comments
Owner

Problem

worktree finish exits 1 with Merge conflicts in: but leaves no merge in progress. The os:worktree skill tells the orchestrator to resolve the conflicts and run finish again. No conflicted files exist to resolve, so the skill step is not possible.

Observed

On 2026-10-19 the session finished branch tooling-crc-placement. Another session had merged ticket-1143 into main (0cd8943e) after the branch started. Both the branch and main had added one History row to the end of docs/implementation-status/os-sdlc.md.

worktree finish tooling-crc-placement
Merge conflicts in: docs/implementation-status/os-sdlc.md
exit 1

After the exit, git status --short was empty in the main checkout and in the worktree. The worktree file had no conflict markers.

Reproduce

worktree start a && (commit an append to file F) ; on main, commit a different append to F ; worktree finish a

Origin

  • Trigger: worktree finish tooling-crc-placement, session abfbc12c, 2026-10-19
  • Improvised this session: git merge main in the worktree, resolved the conflict by hand, committed, then ran finish again. Finish fast-forwarded and exited 0.
  • Chain: skill step not possible ← CLI exit 1 with no open merge (observed output above) ← the finish table in plugins/os/skills/worktree/SKILL.md expects an open merge for exit 1 ← DESIGN (worktree CLI finish)
  • Root candidate: none found; searched worktree, finish, merge conflict, exit 1, FinishCommand (#849 is a different fault)
  • Where: plugin os, the worktree CLI finish command and plugins/os/skills/worktree/SKILL.md finish step 3
  • Session: abfbc12c-5fab-48fd-b36a-2d511ec1522c
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/abfbc12c-5fab-48fd-b36a-2d511ec1522c.jsonl
    VERDICT: CREATE
## Problem `worktree finish` exits 1 with `Merge conflicts in:` but leaves no merge in progress. The os:worktree skill tells the orchestrator to resolve the conflicts and run finish again. No conflicted files exist to resolve, so the skill step is not possible. ## Observed On 2026-10-19 the session finished branch `tooling-crc-placement`. Another session had merged `ticket-1143` into main (0cd8943e) after the branch started. Both the branch and main had added one History row to the end of `docs/implementation-status/os-sdlc.md`. ``` worktree finish tooling-crc-placement ``` ``` Merge conflicts in: docs/implementation-status/os-sdlc.md exit 1 ``` After the exit, `git status --short` was empty in the main checkout and in the worktree. The worktree file had no conflict markers. ## Reproduce ``` worktree start a && (commit an append to file F) ; on main, commit a different append to F ; worktree finish a ``` ## Origin - Trigger: `worktree finish tooling-crc-placement`, session abfbc12c, 2026-10-19 - Improvised this session: `git merge main` in the worktree, resolved the conflict by hand, committed, then ran finish again. Finish fast-forwarded and exited 0. - Chain: skill step not possible ← CLI exit 1 with no open merge (observed output above) ← the finish table in `plugins/os/skills/worktree/SKILL.md` expects an open merge for exit 1 ← DESIGN (worktree CLI finish) - Root candidate: none found; searched worktree, finish, merge conflict, exit 1, FinishCommand (#849 is a different fault) - Where: plugin os, the `worktree` CLI finish command and `plugins/os/skills/worktree/SKILL.md` finish step 3 - Session: abfbc12c-5fab-48fd-b36a-2d511ec1522c - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/abfbc12c-5fab-48fd-b36a-2d511ec1522c.jsonl VERDICT: CREATE
Author
Owner

Occurrence: os: worktree finish reports merge conflicts and exits 1 but leaves no merge open
Seen: plugins/os/bin/worktree finish, fast-batch-14 on 2026-10-25; main had moved (ticket-1315 merge 59f6cdb0) past the batch base a830d451
Run: session b0b47602-97a4-4f51-a9b8-54b228fc3ed3
Adds: second occurrence; the conflict was in docs/implementation-status/os-backlog.md History table (two rows, one per branch). Workaround again: git merge main inside the worktree, resolve, commit, rerun finish (fast-forward, exit 0). The case is 'base moved' (exit 2 in the SKILL.md table) but the CLI reports the exit-1 message.

Occurrence: os: worktree finish reports merge conflicts and exits 1 but leaves no merge open Seen: plugins/os/bin/worktree finish, fast-batch-14 on 2026-10-25; main had moved (ticket-1315 merge 59f6cdb0) past the batch base a830d451 Run: session b0b47602-97a4-4f51-a9b8-54b228fc3ed3 Adds: second occurrence; the conflict was in docs/implementation-status/os-backlog.md History table (two rows, one per branch). Workaround again: git merge main inside the worktree, resolve, commit, rerun finish (fast-forward, exit 0). The case is 'base moved' (exit 2 in the SKILL.md table) but the CLI reports the exit-1 message.
Author
Owner

From #1589 port check: NOT FIXED. Integration#refusal runs merge_dry_run and returns :conflicts (plugins/os-git/lib/os_git/integration.rb:277-281). Outcome.refused prints 'Merge conflicts in: ...' to stdout and exits 1 (plugins/os-git/lib/os_git/worktree/finish/outcome.rb:21-22, command.rb:305). The dry run starts no merge, so no merge is open in either checkout, as before. Not closed.

From #1589 port check: NOT FIXED. Integration#refusal runs merge_dry_run and returns :conflicts (plugins/os-git/lib/os_git/integration.rb:277-281). Outcome.refused prints 'Merge conflicts in: ...' to stdout and exits 1 (plugins/os-git/lib/os_git/worktree/finish/outcome.rb:21-22, command.rb:305). The dry run starts no merge, so no merge is open in either checkout, as before. Not closed.
Author
Owner

Correction to the last comment: the verdict stands (not fixed), but the line reference was wrong. The code is plugins/os-git/lib/os_git/integration.rb:54-58 (moved_base).

Correction to the last comment: the verdict stands (not fixed), but the line reference was wrong. The code is plugins/os-git/lib/os_git/integration.rb:54-58 (moved_base).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1154
No description provided.