From b9084fcaef7f890e341770c736391cf3a0f8d114 Mon Sep 17 00:00:00 2001 From: Yunxiao Xu Date: Mon, 23 Feb 2026 18:01:17 -0800 Subject: [PATCH] feat(frontend): Allow duplicate progress steps to support cyclical worker loops and retries --- frontend/src/services/chat.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/services/chat.ts b/frontend/src/services/chat.ts index 88ec026..5a424d8 100644 --- a/frontend/src/services/chat.ts +++ b/frontend/src/services/chat.ts @@ -185,9 +185,11 @@ export const ChatService = { const lastMsg = { ...newMessages[lastMsgIndex] } if (lastMsg && lastMsg.role === "assistant") { - // Avoid duplicate start messages - if (!(lastMsg.steps || []).includes(startStatusMap[name])) { - lastMsg.steps = [...(lastMsg.steps || []), startStatusMap[name]] + const currentSteps = lastMsg.steps || [] + // Allow duplicate steps if it's a retry (cycle), + // but avoid spamming the same active step multiple times in a row + if (currentSteps[currentSteps.length - 1] !== startStatusMap[name]) { + lastMsg.steps = [...currentSteps, startStatusMap[name]] newMessages[lastMsgIndex] = lastMsg return newMessages }