diff --git a/frontend/src/components/schedules/RunDetailPanel.test.tsx b/frontend/src/components/schedules/RunDetailPanel.test.tsx index 58eca62c..ce73e0c5 100644 --- a/frontend/src/components/schedules/RunDetailPanel.test.tsx +++ b/frontend/src/components/schedules/RunDetailPanel.test.tsx @@ -204,7 +204,7 @@ describe('RunDetailPanel open session', () => { }) it('opens the original session while a worktree run is still running', async () => { - renderPanel({ ...run, status: 'running', sessionId: 'ses_run', worktreePath: '/abs/worktrees/run-1' }) + renderPanel({ ...run, status: 'running', sessionId: 'ses_run', worktreePath: '/abs/worktrees/run-1', runBranch: 'schedule/1/run-1' }) await clickOpenSession() @@ -219,7 +219,7 @@ describe('RunDetailPanel open session', () => { sessionId: 'ses_run', sessionTitle: 'Daily recap', finishedAt: Date.UTC(2026, 9, 2), - worktreePath: '/abs/worktrees/run-1', + worktreePath: null, runBranch: 'schedule/run-1', commitHash: 'abc123', }) @@ -236,7 +236,7 @@ describe('RunDetailPanel open session', () => { it('includes the error and notes no committed changes for a failed worktree run', async () => { apiMocks.createSessionWithContext.mockResolvedValue({ id: 'ses_new' }) - renderPanel({ ...run, status: 'failed', responseText: null, errorText: 'Model timed out', worktreePath: '/abs/worktrees/run-1' }) + renderPanel({ ...run, status: 'failed', responseText: null, errorText: 'Model timed out', worktreePath: null, runBranch: 'schedule/1/run-1' }) await clickOpenSession() @@ -250,7 +250,7 @@ describe('RunDetailPanel open session', () => { }) it('shows a single open session button', async () => { - renderPanel({ ...run, sessionId: 'ses_run', worktreePath: '/abs/worktrees/run-1' }) + renderPanel({ ...run, sessionId: 'ses_run', worktreePath: null, runBranch: 'schedule/1/run-1' }) await waitFor(() => expect(screen.getByRole('button', { name: 'Open session' })).toBeEnabled()) expect(screen.getAllByRole('button', { name: /session|repo/i })).toHaveLength(1) diff --git a/frontend/src/components/schedules/RunDetailPanel.tsx b/frontend/src/components/schedules/RunDetailPanel.tsx index 12c7b462..7775ac16 100644 --- a/frontend/src/components/schedules/RunDetailPanel.tsx +++ b/frontend/src/components/schedules/RunDetailPanel.tsx @@ -70,7 +70,7 @@ export function RunDetailPanel({ repoId, activeRun, selectedRunLoading, onCancel const { sessionId } = activeRun - const opensNewRepoSession = Boolean(activeRun.worktreePath) && activeRun.status !== 'running' + const opensNewRepoSession = Boolean(activeRun.runBranch) && activeRun.status !== 'running' const handleOpenSession = async () => { if (!opensNewRepoSession) {