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] }
|
const lastMsg = { ...newMessages[lastMsgIndex] }
|
||||||
|
|
||||||
if (lastMsg && lastMsg.role === "assistant") {
|
if (lastMsg && lastMsg.role === "assistant") {
|
||||||
// Avoid duplicate start messages
|
const currentSteps = lastMsg.steps || []
|
||||||
if (!(lastMsg.steps || []).includes(startStatusMap[name])) {
|
// Allow duplicate steps if it's a retry (cycle),
|
||||||
lastMsg.steps = [...(lastMsg.steps || []), startStatusMap[name]]
|
// 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
|
newMessages[lastMsgIndex] = lastMsg
|
||||||
return newMessages
|
return newMessages
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user