Skip to content

Commit ca47f62

Browse files
npowclaude
andcommitted
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) <noreply@anthropic.com>
1 parent 15e8f04 commit ca47f62

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/pages/Task/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
33
import styled from 'styled-components';
44
import { SetQuery, StringParam, useQueryParams } from 'use-query-params';
55
import { apiHttp } from '@/constants';
6-
import { Artifact, AsyncStatus, Run as IRun, Task as ITask } from '@/types';
6+
import { Artifact, AsyncStatus, Run as IRun, Task as ITask, TaskStatus } from '@/types';
77
import AnchoredView from '@pages/Task/components/AnchoredView';
88
import ArtifactActionBar from '@pages/Task/components/ArtifactActionBar';
99
import ArtifactTable from '@pages/Task/components/ArtifactTable';
@@ -74,6 +74,11 @@ const emptyFn = () => {
7474
/*intentional*/
7575
};
7676

77+
// Tasks killed by the runtime (e.g. Titus OOM/eviction) never write attempt-done
78+
// metadata, so finished_at stays null. Treat these terminal statuses as done so
79+
// logs are fetched regardless.
80+
const TERMINAL_TASK_STATUSES: TaskStatus[] = ['completed', 'failed', 'unknown'];
81+
7782
//
7883
// Component
7984
//
@@ -163,7 +168,7 @@ const Task: React.FC<TaskViewProps> = ({
163168
}
164169
}, [task, addDataToStore]);
165170

166-
const isCurrentTaskFinished = !!(task && task.finished_at);
171+
const isCurrentTaskFinished = !!(task && (task.finished_at || TERMINAL_TASK_STATUSES.includes(task.status)));
167172
const isLatestAttempt = attemptId === (tasks?.length || 1) - 1;
168173

169174
const handleToggleCollapse = (type: 'expand' | 'collapse') =>

0 commit comments

Comments
 (0)