From 6cbbc5caf6afe4d8ff65ab6ecf6e911ee71a222f Mon Sep 17 00:00:00 2001
From: hit-cxf <2024111082@stu.hit.edu.cn>
Date: Mon, 06 Apr 2026 17:37:49 +0800
Subject: [PATCH] 添加了设置剧集数量的功能

---
 aigc-director/aigc-claw/backend/core/orchestrator.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/aigc-director/aigc-claw/backend/core/orchestrator.py b/aigc-director/aigc-claw/backend/core/orchestrator.py
index a1ce849..1fa6121 100644
--- a/aigc-director/aigc-claw/backend/core/orchestrator.py
+++ b/aigc-director/aigc-claw/backend/core/orchestrator.py
@@ -219,10 +219,14 @@
 
         try:
             result = await agent.process(input_data, intervention=intervention)
+            if not isinstance(result, dict):
+                logger.error(f"[execute_stage] Agent {stage.value} returned non-dict result: {type(result)}")
+                result = {"payload": result}
+            
             state.artifacts[stage.value] = result.get("payload")
 
-            # 第三阶段修改分镜时:同步更新第四、第五阶段的相关内容
-            if stage.value == "storyboard" and intervention and "modified_storyboard" in intervention:
+            # 只有在 storyboard 阶段明确有修改时才执行同步
+            if stage.value == "storyboard" and isinstance(intervention, dict) and "modified_storyboard" in intervention:
                 modified_shots = intervention["modified_storyboard"]
                 if isinstance(modified_shots, list):
                     shot_durations = {s.get('shot_id'): s.get('duration', 10)

--
Gitblit v1.8.0