Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions stay-scout-hub/src/app/api/research-area/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown>, area, city);
Expand Down
2 changes: 1 addition & 1 deletion stay-scout-hub/src/lib/api/area-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down