Repository navigation
Conversation
A conflicted stash pop, merge --squash or checkout -m leaves unmerged entries with no sequencer marker, so commitRemaining's only guard let 'git add -A' stage the conflict-marked file and commit it. Refuse on any unmerged porcelain XY, and report unmergedPaths from getWorktreeStatus so the Done-flow rail disables Commit and the commit-PR stack with a reason.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…k-commit-and-commit-pr-stages-and-commit
…k-commit-and-commit-pr-stages-and-commit # Conflicts: # packages/host-core/src/agent-commands.test.ts
…k-commit-and-commit-pr-stages-and-commit
This was referenced Oct 18, 2026
…k-commit-and-commit-pr-stages-and-commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#909 has merged; this PR is no longer stacked. Against main it is the single VC-838 change (15 files). History of the earlier stack is kept below.
Stacked on #909 (which is itself stacked on #885). Merge after #909.git merge-treereported a content conflict with #909 inpackages/host-core/src/worktree/status.ts, because #909 wrapsgetWorktreeStatus's reads inreadOnlyGitAsync. So this branch is #909's head plus one commit (fix(VC-838): …). Only that last commit belongs to this PR.Defect
commitRemaining(packages/host-core/src/worktree/commit.ts) checked for conflicts only through the sequencer-marker probe (MERGE_HEAD,CHERRY_PICK_HEAD,REVERT_HEAD,BISECT_LOG,rebase-merge,rebase-apply). Some conflicts leave unmerged index entries without any of those markers: a conflictedgit stash pop/apply,git merge --squash(noMERGE_HEADfor--squash) andgit checkout -m. In that state,git add -Astages the conflict-marked file and marks it resolved, so thegit committhat follows succeeds and<<<<<<</>>>>>>>markers get committed. On the "Commit & create draft PR" path the result is also pushed and opened as a PR. The Done-flow rail kept Commit and the commit-PR stack enabled becausegetWorktreeStatusreported nothing that would disable them.Fix
status.ts: newcountUnmergedEntries(porcelain)counts porcelain v1 entries whose XY is one ofDD AU UD UA DU AA UU.getWorktreeStatusnow reportsunmergedPaths: number, taken from the samegit status --porcelainread it already did, so there is no extra subprocess.commit.ts: after the clean-tree no-op and before any staging,commitRemainingrefuses with "This worktree has unresolved conflicts … Resolve them before committing." whencountUnmergedEntries > 0. Nothing is staged and nothing is committed.worktree-done-flow-model.ts: Commit, "Commit & create draft PR" and "Commit & push updates" are disabled with "Unresolved conflicts. Resolve them in the terminal." whenunmergedPaths > 0. Push-only actions and View PR stay enabled. If a sequencer op is also in progress, its reason is shown instead.ipc/contract.tsWorktreeStatusResultgainsunmergedPaths. Fixtures that construct a status report gainunmergedPaths: 0.How the regression test proves it
I ran the new tests against the original
commit.ts/status.ts/worktree-done-flow-model.ts, then against the fix:commit.test.ts› "commitRemaining with real git" uses real git repos:<<<<<<<, porcelain showsUU file.txt, no sequencer marker). It then callscommitRemainingwithincludeUnstagedtrue and false. On main, theokassertion fails: the call returnedok: trueand committed the markers. With the fix it errs, HEAD does not move, and the path is stillUU.MERGE_HEADand the file has markers. On main the commit landed. With the fix it errs and HEAD does not move.commit.test.tsscripted cases: each of the 7 unmerged XY codes, plusincludeUnstaged: false, refuses with noadd/commitcall. All failed on main.status.test.ts:unmergedPathscounts all 7 codes and ignoresM/A/??. It is0on a failed status read. Failed on main.worktree-done-flow-model.test.ts: 4 new cases for the unmerged rule. 3 failed on main; the 4th, sequencer precedence, passes on both.Local runs, all green: host-core
commit,status,read,snapshot,ticket-move,agent-commandstests (286 tests). Desktopworktree-done-flow-model,worktree-glance-model,ticket-changes-panel,data-ipctests (296 tests).vp check. host-core and desktoptypecheck.Decisions
<<<<<<<would false-positive on files that contain marker strings on purpose (tests, docs) and block legitimate commits. The real-git tests do run against a conflict-marked file, which is the stash-pop/squash case. A file whose markers were alreadygit added by hand is out of scope.includeUnstaged: false,git commitwould already have refused on unmerged files. Refusing earlier gives the same outcome with a clearer message. TheincludeUnstaged: falsestaging semantics are unchanged.unmergedPathsis0when the status read fails.uncommittedalready reports dirty in that case, andcommitRemainingre-reads status and refuses or errs on its own, so the rail does not invent a conflict it cannot see.Not in this PR
volli worktree statushuman renderer (packages/cli/src/render.ts) does not printunmergedPaths. The--jsonoutput now includes the field (additive).commitRemaining1 MB maxBuffer) will stack on this PR.CI history
fc42d0746): green exceptCheck + Build. It failed on main's own react(purity) error (VC-853). After VC-294: compute the Updates status clock outside render (unbreaks main: react/purity) #923 fixed it, merging main gave a fully green run at02bbb9834.agent-commands.test.ts. I kept VC-834: background Change Set/rail/venue/diff reads run read-only git (stacked on #885 — merge after it) #909'sscriptedReadOnlyGitand main's removal of thegitport. That run was red because main itself was red; VC-786: drop the removed git port from tests merged beside #908 (unbreaks main typecheck) #925 fixed it.scriptedGit, but the stacked VC-834: background Change Set/rail/venue/diff reads run read-only git (stacked on #885 — merge after it) #909 reads lead with--no-optional-locks. Commit9ad35395egives those two testsscriptedReadOnlyGit, the same swap VC-834: background Change Set/rail/venue/diff reads run read-only git (stacked on #885 — merge after it) #909 made for its own fixtures. Re-create it if VC-834: background Change Set/rail/venue/diff reads run read-only git (stacked on #885 — merge after it) #909 is rebased onto main first.9ad35395e,Test (packages)timed out (5000 ms) on watch.test.ts "500 Done tickets merged in an earlier launch…" (VC-836). Nothing on this branch toucheswatch.tsor anything it calls. The test takes 3085 ms on main's CI and 2158 ms locally on this branch. I reran the failed jobs once (run 39133837114) and they passed.CI gateis green.76f78fa98). All 23 checks pass andCI gateis green (run 39261297540).