Skip to content

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

fix(cos): preserve worktree on push failure in openPR mode instead of auto-merging

Adam Eivya206ddad2d3e
diff --git a/server/services/subAgentSpawner.js b/server/services/subAgentSpawner.js
index e1cdb00f08..565c167cc3 100644
--- a/server/services/subAgentSpawner.js
+++ b/server/services/subAgentSpawner.js
@@ -2007,11 +2007,8 @@ async function cleanupAgentWorktree(agentId, success, { openPR = false, descript
return;
}
- // Push failed — fall back to auto-merge so commits aren't lost
- emitLog('warn', `🌳 Push failed for ${worktreeBranch}, falling back to auto-merge`, { agentId });
- await removeWorktree(agentId, sourceWorkspace, worktreeBranch, { merge: true }).catch(err => {
- emitLog('warn', `🌳 Worktree cleanup failed for ${agentId}: ${err.message}`, { agentId });
- });
+ // Push failed — preserve worktree/branch for manual intervention (do NOT auto-merge in openPR mode)
+ emitLog('warn', `🌳 Push failed for ${worktreeBranch} — worktree preserved at ${worktreePath} for manual retry`, { agentId, branchName: worktreeBranch });
return;
}