From 899395ab8fabb102a3bc236d988d2e5638c8e2c9 Mon Sep 17 00:00:00 2001 From: OneStepAt4time Date: Sat, 11 Apr 2026 00:42:11 +0200 Subject: [PATCH] fix(ui): use robust results length for completion detection --- src/ui/status.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ui/status.ts b/src/ui/status.ts index 3904e05..756d35e 100644 --- a/src/ui/status.ts +++ b/src/ui/status.ts @@ -49,10 +49,8 @@ export function buildGetAgentStatusScript(selectors?: SelectorSet): string { } if (hasStopButton || hasLoadingSpinner) status = "working"; - else if (bodyText.indexOf('Steps completed') !== -1 || (bodyText.indexOf('Finished') !== -1 && !hasStopButton)) status = "completed"; - else if (/Reviewed\\s+\\d+\\s+sources/.test(bodyText) && !hasWorkingText) status = "completed"; else if (hasWorkingText) status = "working"; - else if (bodyText.indexOf('Ask a follow-up') !== -1 && results.length > 0 && !hasStopButton) status = "completed"; + else if (results.length > 0) status = "completed"; return JSON.stringify({ status: status, steps: steps, currentStep: currentStep, response: response, hasStopButton: hasStopButton, hasLoadingSpinner: hasLoadingSpinner, proseCount: results.length }); })()`