Skip to content

Commit a86cb2b

Browse files
committed
review fixes
1 parent 84e2e85 commit a86cb2b

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

apps/code/src/main/services/agent/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export const subscribeSessionInput = z.object({
183183
taskRunId: z.string(),
184184
});
185185

186-
// Record activity input — keeps the idle timeout debounce alive for the given session
186+
// Record activity input — resets the idle timeout for the given session
187187
export const recordActivityInput = z.object({
188188
taskRunId: z.string(),
189189
});

apps/code/src/renderer/features/task-detail/components/TaskLogsPanel.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { toast } from "@utils/toast";
3434
import { useCallback, useEffect, useMemo, useRef } from "react";
3535

3636
const log = logger.scope("task-logs-panel");
37+
const ACTIVITY_HEARTBEAT_MS = 5 * 60 * 1000;
3738

3839
interface TaskLogsPanelProps {
3940
taskId: string;
@@ -136,12 +137,9 @@ export function TaskLogsPanel({ taskId, task }: TaskLogsPanelProps) {
136137
const taskRunId = session?.taskRunId;
137138
if (!taskRunId) return;
138139
trpcClient.agent.recordActivity.mutate({ taskRunId }).catch(() => {});
139-
const heartbeat = setInterval(
140-
() => {
141-
trpcClient.agent.recordActivity.mutate({ taskRunId }).catch(() => {});
142-
},
143-
5 * 60 * 1000,
144-
);
140+
const heartbeat = setInterval(() => {
141+
trpcClient.agent.recordActivity.mutate({ taskRunId }).catch(() => {});
142+
}, ACTIVITY_HEARTBEAT_MS);
145143
return () => clearInterval(heartbeat);
146144
}, [session?.taskRunId]);
147145

0 commit comments

Comments
 (0)