Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (self): drive CONFLICTED branches to merge like every other reconcile state
[._.]/ Adam Eivy65093499a631
diff --git a/server/services/branchReconcile.js b/server/services/branchReconcile.jsindex 945617021e..fdd06fdad1 100644--- a/server/services/branchReconcile.js+++ b/server/services/branchReconcile.js@@ -587,7 +587,11 @@ export function desiredEndState(state, actions, { prNumber, worktreePath, collis// told by GitHub that it collides with the default branch, so "resolve the// conflicts" without first asking whether the work is still wanted is// precisely how a superseded branch gets merged looking deliberate.- return `${stillNeeded} If it is still needed: rebase the branch onto the default branch, resolve all conflicts, run the tests, and push. ${verifyGate}`;+ const resolve = `${stillNeeded} If it is still needed: rebase the branch onto the default branch, resolve all conflicts, run the tests, and push. ${verifyGate}`;+ if (!actionOn(actions, 'autoMerge')) {+ return `${resolve} Do NOT merge (auto-merge is disabled) — stop once the conflicts are resolved and pushed, and report the PR's URL.`;+ }+ return `${resolve} ${driveToMerge(pr)}`;}// IN_REVIEWconst canMerge = actionOn(actions, 'autoMerge');diff --git a/server/services/branchReconcile.test.js b/server/services/branchReconcile.test.jsindex b5c4ec8c81..8687f00f56 100644--- a/server/services/branchReconcile.test.js+++ b/server/services/branchReconcile.test.js@@ -552,6 +552,17 @@ describe('desiredEndState', () => {expect(desiredEndState('CONFLICTED', {})).toContain('Rebase');});+ // CONFLICTED must drive to merge exactly like the other three merge-eligible+ // states — otherwise an agent that resolves conflicts and pushes just stops,+ // leaving a green PR open until the next scheduled run re-classifies it as+ // IN_REVIEW, contradicting driveToMerge's own "opening the PR is NOT the end+ // state" principle.+ it('tells CONFLICTED to merge only when autoMerge is on', () => {+ expect(desiredEndState('CONFLICTED', {})).toContain('gh pr merge <num> --merge --delete-branch');+ expect(desiredEndState('CONFLICTED', { autoMerge: false })).toContain('Do NOT merge');+ expect(desiredEndState('CONFLICTED', { autoMerge: false })).not.toContain('gh pr merge');+ });+// The miss this pins: a NEEDS_PR run opened a PR, reported "left open for// review", and exited 51s later — while CI was still running on a branch the// task was supposed to finish. "PR opened" is a step, not the end state.