diff --git a/stay-scout-hub/src/app/api/research-area/route.ts b/stay-scout-hub/src/app/api/research-area/route.ts index be3ac00d1..84c9dedfc 100644 --- a/stay-scout-hub/src/app/api/research-area/route.ts +++ b/stay-scout-hub/src/app/api/research-area/route.ts @@ -128,6 +128,12 @@ RETURN JSON ONLY (no markdown): enqueue({ type: "SCREENSHOT", data: { streamingUrl: event.streaming_url } }); } + // The client renders this as the current action. Without it, progress + // text stays on the initial message for the whole run. + if (event.type === EventType.PROGRESS) { + enqueue({ type: "STATUS", message: event.purpose }); + } + if (event.type === EventType.COMPLETE && event.status === RunStatus.COMPLETED) { const raw = typeof event.result === "string" ? JSON.parse(event.result) : event.result; const analysis = parseResearchResult(raw as Record, area, city); diff --git a/stay-scout-hub/src/lib/api/area-search.ts b/stay-scout-hub/src/lib/api/area-search.ts index 0706a79c3..928f9ed73 100644 --- a/stay-scout-hub/src/lib/api/area-search.ts +++ b/stay-scout-hub/src/lib/api/area-search.ts @@ -83,7 +83,7 @@ export function researchArea( }); } - if (event.type === 'STATUS') { + if (event.type === 'CONNECTED' || event.type === 'STATUS') { onStatus({ areaId: area.id, areaName: area.name,