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 }