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([issue-4284]): return canonical worktree ownership reasons

[._.]/ Adam Eivy788ea796a436
diff --git a/server/services/worktreeManager.js b/server/services/worktreeManager.js
index 91c5990792..75f450e140 100644
--- a/server/services/worktreeManager.js
+++ b/server/services/worktreeManager.js
@@ -1114,13 +1114,7 @@ export async function reapMergedWorktrees(sourceWorkspace, {
requireKnownLiveness: true,
});
if (ownershipReason) {
- const reason = {
- 'worktree-human-claim': 'human-claim',
- 'worktree-active-agent': 'active-agent',
- 'worktree-locked': 'locked',
- 'worktree-unmanaged-location': 'unmanaged-location',
- }[ownershipReason] || ownershipReason;
- skipped.push({ path: wt.path, reason });
+ skipped.push({ path: wt.path, reason: ownershipReason });
continue;
}
if (isClaudeTree && !includeClaudeTrees) { skipped.push({ path: wt.path, reason: 'claude-tree-excluded' }); continue; }
diff --git a/server/services/worktreeReap.test.js b/server/services/worktreeReap.test.js
index bd3d3aec9e..ac28d2a2fc 100644
--- a/server/services/worktreeReap.test.js
+++ b/server/services/worktreeReap.test.js
@@ -199,7 +199,7 @@ describe('reapMergedWorktrees', () => {
const result = await reapMergedWorktrees(dir, { includeClaudeTrees: true });
expect(result.reaped.map(r => r.branch)).not.toContain('locked-br');
- expect(skipReason(result, path)).toBe('locked');
+ expect(skipReason(result, path)).toBe('worktree-locked');
expect(existsSync(path)).toBe(true);
});
@@ -213,7 +213,7 @@ describe('reapMergedWorktrees', () => {
});
expect(result.reaped.map(r => r.branch)).not.toContain('active-br');
- expect(skipReason(result, path)).toBe('active-agent');
+ expect(skipReason(result, path)).toBe('worktree-active-agent');
expect(existsSync(path)).toBe(true);
// The main repo checkout is never reported as reaped or skipped-with-branch.
expect(result.reaped.find(r => r.branch === 'main')).toBeUndefined();