fix(ui): preserve runtime worktree source (#1259)

Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
This commit is contained in:
Isaac Sanchez-Hawkins
2026-05-14 02:06:21 +03:00
committed by GitHub
co-authored by Isaac Sanchez
parent ef85c63336
commit bac655ddb4
2 changed files with 2 additions and 2 deletions
@@ -238,6 +238,7 @@ describe('resolveSessionWorktreeState', () => {
expect(result.legacy).toBe(false); expect(result.legacy).toBe(false);
expect(result.worktreeRoot).toBe('/repo/worktrees/feat-a'); expect(result.worktreeRoot).toBe('/repo/worktrees/feat-a');
expect(result.worktreeSource).toBe('existing');
expect(result.degraded).toBe(false); expect(result.degraded).toBe(false);
}); });
@@ -657,4 +658,3 @@ describe('getMutationBlockingReasons', () => {
expect(reasons[0]).toEqual({ reason: 'dirty' }); expect(reasons[0]).toEqual({ reason: 'dirty' });
}); });
}); });
@@ -104,7 +104,7 @@ export function resolveSessionWorktreeState(
branch: runtimeResolution.branch ?? metadata?.branch ?? null, branch: runtimeResolution.branch ?? metadata?.branch ?? null,
headState: runtimeResolution.headState ?? 'branch', headState: runtimeResolution.headState ?? 'branch',
worktreeStatus: runtimeResolution.worktreeStatus ?? 'ready', worktreeStatus: runtimeResolution.worktreeStatus ?? 'ready',
worktreeSource: runtimeResolution.worktreeSource ?? metadata?.source === 'sdk' ? 'created-for-session' : 'existing', worktreeSource: runtimeResolution.worktreeSource ?? (metadata?.source === 'sdk' ? 'created-for-session' : 'existing'),
legacy: false, legacy: false,
degraded: runtimeResolution.degraded, degraded: runtimeResolution.degraded,
attentionReason: runtimeResolution.attentionReason ?? null, attentionReason: runtimeResolution.attentionReason ?? null,