feat(frontend): Allow duplicate progress steps to support cyclical worker loops and retries
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user