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

This commit is contained in:
ddCat
2026-08-27 22:39:30 +08:00
parent 482d8bdbc2
commit 7cb6aed27d
18 changed files with 944 additions and 44 deletions

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
}
}