diff --git a/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx b/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx index ab3ed3e..b209062 100644 --- a/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx +++ b/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx @@ -478,7 +478,7 @@ function WorkerAssetBadge({ assets }: { assets: IntentAsset[] }) { ); } -export function SessionsTab({ taskId }: { taskId: string }) { +export function SessionsTab({ taskId, taskPaused = false }: { taskId: string; taskPaused?: boolean }) { const approvalFocus = useApprovalFocus({ taskId }); const [selectedSessionId, setActiveId] = React.useState(MAIN_ID); const focusSession = React.useMemo(() => { @@ -1416,6 +1416,9 @@ export function SessionsTab({ taskId }: { taskId: string }) { // Run duration = span from this session's first step to its last (for a live // session, "now" so it ticks up — the 1.5s setTick above re-renders it). + // While the TASK is paused nothing time-derived may advance (#84): sessions + // keep state='running' in the store during a pause, so live alone would keep + // ticking and misrepresent the frozen budget. Freeze at the last step instead. const runDuration = React.useMemo(() => { let min = Infinity, max = 0; @@ -1426,9 +1429,9 @@ export function SessionsTab({ taskId }: { taskId: string }) { if (t > max) max = t; } if (!Number.isFinite(min) || max === 0) return null; - const end = active.live ? Date.now() : max; + const end = active.live && !taskPaused ? Date.now() : max; return Math.max(0, end - min); - }, [activity, active.live]); + }, [activity, active.live, taskPaused]); // ---- transcript auto-scroll (open → bottom; stick to bottom unless scrolled up) ---- const contentRef = React.useRef(null); diff --git a/web/src/app/(main)/function/tasks/detail/page.tsx b/web/src/app/(main)/function/tasks/detail/page.tsx index 5dea22e..2f86133 100644 --- a/web/src/app/(main)/function/tasks/detail/page.tsx +++ b/web/src/app/(main)/function/tasks/detail/page.tsx @@ -420,7 +420,7 @@ function TaskDetailInner() { {/* Tab content */}
- +