From ca47f62293cd1260b7679a5d8fb2b4a779ceaed7 Mon Sep 17 00:00:00 2001 From: npow Date: Thu, 25 Jun 2026 21:10:28 +0000 Subject: [PATCH] fix: show logs for tasks killed by runtime without finished_at Tasks killed by Titus (OOM, eviction, etc.) never write the attempt-done metadata record, leaving finished_at null. The UI gated log fetching on finished_at being set, so logs were silently never fetched even when they existed in S3. Fix: treat any terminal task status (completed, failed, unknown) as "finished enough" to fetch logs, regardless of finished_at. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- src/pages/Task/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/Task/index.tsx b/src/pages/Task/index.tsx index e59997c2..b2f2148a 100755 --- a/src/pages/Task/index.tsx +++ b/src/pages/Task/index.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; import { SetQuery, StringParam, useQueryParams } from 'use-query-params'; import { apiHttp } from '@/constants'; -import { Artifact, AsyncStatus, Run as IRun, Task as ITask } from '@/types'; +import { Artifact, AsyncStatus, Run as IRun, Task as ITask, TaskStatus } from '@/types'; import AnchoredView from '@pages/Task/components/AnchoredView'; import ArtifactActionBar from '@pages/Task/components/ArtifactActionBar'; import ArtifactTable from '@pages/Task/components/ArtifactTable'; @@ -74,6 +74,11 @@ const emptyFn = () => { /*intentional*/ }; +// Tasks killed by the runtime (e.g. Titus OOM/eviction) never write attempt-done +// metadata, so finished_at stays null. Treat these terminal statuses as done so +// logs are fetched regardless. +const TERMINAL_TASK_STATUSES: TaskStatus[] = ['completed', 'failed', 'unknown']; + // // Component // @@ -163,7 +168,7 @@ const Task: React.FC = ({ } }, [task, addDataToStore]); - const isCurrentTaskFinished = !!(task && task.finished_at); + const isCurrentTaskFinished = !!(task && (task.finished_at || TERMINAL_TASK_STATUSES.includes(task.status))); const isLatestAttempt = attemptId === (tasks?.length || 1) - 1; const handleToggleCollapse = (type: 'expand' | 'collapse') =>