diff --git a/apps/fabro-web/app/routes/run-stages.test.ts b/apps/fabro-web/app/routes/run-stages.test.ts index a7024b3ef..2238aaf74 100644 --- a/apps/fabro-web/app/routes/run-stages.test.ts +++ b/apps/fabro-web/app/routes/run-stages.test.ts @@ -884,7 +884,7 @@ describe("buildChatItems", () => { }); describe("buildStageActivity pending tools", () => { - test("records watchdog settlement during the activity pass", () => { + test("records watchdog settlement only for the selected stage", () => { const events: EventEnvelope[] = [ envelope(1, { event: "watchdog.timeout", @@ -894,6 +894,7 @@ describe("buildStageActivity pending tools", () => { ]; expect(buildStageActivity(events, "plan@1").watchdogTimedOut).toBe(true); + expect(buildStageActivity(events, "code@1").watchdogTimedOut).toBe(false); }); test("returns started-but-not-completed calls for the stage", () => { diff --git a/apps/fabro-web/app/routes/run-stages.tsx b/apps/fabro-web/app/routes/run-stages.tsx index d45416939..48111ce23 100644 --- a/apps/fabro-web/app/routes/run-stages.tsx +++ b/apps/fabro-web/app/routes/run-stages.tsx @@ -291,12 +291,14 @@ export function buildStageActivity( for (const e of events) { const eventName = e.event; + if (activityEventStageId(e) !== stageId) { + continue; + } if (eventName === "watchdog.timeout") { watchdogTimedOut = true; continue; } if ( - activityEventStageId(e) !== stageId || !eventName || !STAGE_ACTIVITY_EVENT_SET.has(eventName) ) {