From b3bccf36481cd820ec405bdccbe03d0f6738f1c5 Mon Sep 17 00:00:00 2001 From: Devin Foley Date: Fri, 27 Mar 2026 00:02:57 -0700 Subject: [PATCH] Fix LiveRunWidget activeRun merge bug and add idle_warning clear test - Fix: activeRun merge in LiveRunWidget was dropping errorCode and lastOutputAt, preventing idle badge and last-output display from rendering for active runs - Add test: verify reportRunActivity clears idle_warning error code and updates lastOutputAt Co-Authored-By: Paperclip --- .../heartbeat-process-recovery.test.ts | 18 ++++++++++++++++++ ui/src/components/LiveRunWidget.tsx | 2 ++ 2 files changed, 20 insertions(+) diff --git a/server/src/__tests__/heartbeat-process-recovery.test.ts b/server/src/__tests__/heartbeat-process-recovery.test.ts index 43a4288b..b431a60c 100644 --- a/server/src/__tests__/heartbeat-process-recovery.test.ts +++ b/server/src/__tests__/heartbeat-process-recovery.test.ts @@ -332,4 +332,22 @@ describeEmbeddedPostgres("heartbeat orphaned process recovery", () => { expect(run?.errorCode).toBeNull(); expect(run?.error).toBeNull(); }); + + it("clears the idle warning when the run reports activity again", async () => { + const { runId } = await seedRunFixture({ + includeIssue: false, + runErrorCode: "idle_warning", + runError: "Idle warning: no output for 10 minutes", + }); + const heartbeat = heartbeatService(db); + + const updated = await heartbeat.reportRunActivity(runId); + expect(updated?.errorCode).toBeNull(); + expect(updated?.error).toBeNull(); + expect(updated?.lastOutputAt).toBeTruthy(); + + const run = await heartbeat.getRun(runId); + expect(run?.errorCode).toBeNull(); + expect(run?.error).toBeNull(); + }); }); diff --git a/ui/src/components/LiveRunWidget.tsx b/ui/src/components/LiveRunWidget.tsx index 09b41f87..68e82efd 100644 --- a/ui/src/components/LiveRunWidget.tsx +++ b/ui/src/components/LiveRunWidget.tsx @@ -68,6 +68,8 @@ export function LiveRunWidget({ issueId, companyId }: LiveRunWidgetProps) { agentId: activeRun.agentId, agentName: activeRun.agentName, adapterType: activeRun.adapterType, + errorCode: activeRun.errorCode, + lastOutputAt: toIsoString(activeRun.lastOutputAt), issueId, }); }