fix(canvas): 文本生成 - 修复分镜超时并贯通 Agent 与创作页流式返回

This commit is contained in:
ddCat committed 2026-08-27 22:39:30 +08:00
1 parent 21b69d8bc7
commit 474f21d56b
18 files changed
+944 -44

No files matched your search

+8
View File
@@ -234,6 +234,10 @@ func streamTaskTextEvents(c *gin.Context, svc *service.Service, userID string, t
return
}
c.Writer.Flush()
lastStatus := replay.Status
lastStage := replay.Stage
lastProgress := replay.Progress
writeTaskTextSSE(c, "progress", 0, map[string]any{"status": replay.Status, "stage": replay.Stage, "progress": replay.Progress})
pollTicker := time.NewTicker(750 * time.Millisecond)
heartbeatTicker := time.NewTicker(15 * time.Second)
@@ -263,6 +267,10 @@ func streamTaskTextEvents(c *gin.Context, svc *service.Service, userID string, t
writeTaskTextSSE(c, "error", 0, map[string]string{"message": "任务文本流不可用"})
return
}
if next.Status != lastStatus || next.Stage != lastStage || next.Progress != lastProgress {
writeTaskTextSSE(c, "progress", 0, map[string]any{"status": next.Status, "stage": next.Stage, "progress": next.Progress})
lastStatus, lastStage, lastProgress = next.Status, next.Stage, next.Progress
}
replay = next
}
}