From 7c4c956be0c3c4c2f76f181e356779003bc8f998 Mon Sep 17 00:00:00 2001
From: log
Date: Thu, 25 Jun 2026 22:21:07 +0800
Subject: [PATCH] fix: replace favicon.ico with icon.png to resolve build error

---
 video-claw/video-claw/backend/core/orchestrator.py |   50 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/video-claw/video-claw/backend/core/orchestrator.py b/video-claw/video-claw/backend/core/orchestrator.py
index 92ed15a..e8e78bf 100644
--- a/video-claw/video-claw/backend/core/orchestrator.py
+++ b/video-claw/video-claw/backend/core/orchestrator.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
 """
 核心编排器 / 工作流引擎
 管理六阶段状态机,协调各智能体执行,支持用户在任意阶段介入
@@ -62,6 +62,10 @@
     "image_t2i_model",
     "image_it2i_model",
     "video_model",
+    "video_first_frame_model",
+    "video_start_end_model",
+    "video_reference_model",
+    "video_generation_mode",
     "video_style",
     "enable_concurrency",
     "web_search",
@@ -85,6 +89,7 @@
     nested_meta = data.get("meta")
     if isinstance(nested_meta, dict):
         meta.update({k: _normalize_meta_value(v) for k, v in nested_meta.items() if v is not None})
+    # Legacy session compatibility: old session JSON stored these fields at the root instead of under meta.
     for key in SESSION_META_KEYS:
         if key not in meta and key in data and data[key] is not None:
             meta[key] = _normalize_meta_value(data[key])
@@ -193,8 +198,29 @@
                                     state.status[stage.value] = "pending"
                     elif isinstance(loaded_status, dict):
                         state.status = loaded_status
+                        # Scrub running and waiting statuses because this is loading from a restart/crash
+                        for k, v in state.status.items():
+                            if v == "running":
+                                state.status[k] = "error"
+                                state.error = "服务意外中断,任务已停止"
+                            elif v == "waiting":
+                                state.status[k] = "pending"
 
                     state.artifacts = data.get('artifacts', {})
+                    # Scrub running and waiting artifact items
+                    for stage, artifact in state.artifacts.items():
+                        if not isinstance(artifact, dict):
+                            continue
+                        for key in ["clips", "images", "scenes", "characters", "settings"]:
+                            items = artifact.get(key)
+                            if isinstance(items, list):
+                                for item in items:
+                                    if isinstance(item, dict):
+                                        if item.get("status") == "running":
+                                            item["status"] = "failed"
+                                        elif item.get("status") == "waiting":
+                                            item["status"] = "pending"
+
                     state.stage_progress = data.get('stage_progress', {})
                     state.meta = _extract_session_meta(data)
                     state.updated_at = data.get('updated_at', 0)
@@ -1372,7 +1398,7 @@
             if "created_at" not in data:
                 data["created_at"] = time.time()
 
-            # 会话级生成参数统一保存在 meta 中;清理旧版本遗留的根字段。
+            # Legacy session compatibility: clean root-level generation fields left by old session JSON.
             for key in SESSION_META_KEYS:
                 data.pop(key, None)
             
@@ -1445,8 +1471,28 @@
                                 state.status[stage.value] = "pending"
                 elif isinstance(old_status, dict):
                     state.status = old_status
+                    # Scrub running and waiting statuses
+                    for k, v in state.status.items():
+                        if v == "running":
+                            state.status[k] = "error"
+                            state.error = "服务意外中断,任务已停止"
+                        elif v == "waiting":
+                            state.status[k] = "pending"
 
                 state.artifacts = data.get("artifacts", {})
+                # Scrub artifact running/waiting items
+                for stage, artifact in state.artifacts.items():
+                    if not isinstance(artifact, dict):
+                        continue
+                    for key in ["clips", "images", "scenes", "characters", "settings"]:
+                        items = artifact.get(key)
+                        if isinstance(items, list):
+                            for item in items:
+                                if isinstance(item, dict):
+                                    if item.get("status") == "running":
+                                        item["status"] = "failed"
+                                    elif item.get("status") == "waiting":
+                                        item["status"] = "pending"
                 state.stage_progress = data.get("stage_progress", {})
                 state.error = data.get("error")
                 state.updated_at = data.get("updated_at", 0)

--
Gitblit v1.8.0