From ad5c5e3867613ed3e5d3b9016200295fb2da95e8 Mon Sep 17 00:00:00 2001
From: hit-cxf <2024111082@stu.hit.edu.cn>
Date: Sun, 07 Jun 2026 19:41:28 +0800
Subject: [PATCH] Remove old interface and annotation
---
video-claw/video-claw/frontend/components/WorkflowPanel.tsx | 2 +-
video-claw/video-claw/frontend/components/TopBar.tsx | 2 +-
video-claw/video-claw/backend/core/orchestrator.py | 36 +++++++-----------------------------
3 files changed, 9 insertions(+), 31 deletions(-)
diff --git a/video-claw/video-claw/backend/core/orchestrator.py b/video-claw/video-claw/backend/core/orchestrator.py
index c888dd2..92ed15a 100644
--- a/video-claw/video-claw/backend/core/orchestrator.py
+++ b/video-claw/video-claw/backend/core/orchestrator.py
@@ -94,14 +94,13 @@
class WorkflowState:
"""工作流状态"""
- # 状态说明:
- # - pending: 新建会话,还没有任何数据,也没有在运行
- # - running: 会话正在运行
- # - waiting: 会话在某一阶段内等待用户介入(如选择角色、选择图片等)
- # - completed: 会话完成了某一阶段,等待用户确定开始下一阶段
- # - completed: 会话全部完成
- # - stopped: 用户手动停止
- # - error: 执行中遇到错误
+ # 阶段状态说明:
+ # - pending: 阶段还没有产物,也没有在运行
+ # - running: 阶段正在执行
+ # - waiting: 阶段已产出内容,但需要用户介入(如选择角色、选择图片等)
+ # - completed: 阶段已完成,可进入下一阶段
+ # - stopped: 阶段被用户手动停止
+ # - error: 阶段执行中遇到错误
def __init__(self, session_id: str):
self.session_id = session_id
@@ -1004,27 +1003,6 @@
if active_registered:
with self._state_lock:
self._active_sessions.discard(state.session_id)
-
- async def handle_intervention(self,
- session_id: str,
- stage: str,
- modifications: Dict[str, Any]) -> Dict:
- with self._state_lock:
- state = self.get_state(session_id)
- if not state:
- raise KeyError(f"Session not found: {session_id}")
- current_artifact = copy.deepcopy(state.artifacts.get(stage, {}))
- stage_enum = WorkflowStage(stage)
-
- input_data = current_artifact if isinstance(current_artifact, dict) else {}
- input_data.update(modifications)
-
- res = await self.execute_stage(state, stage_enum, input_data, intervention=modifications)
- with self._state_lock:
- # 处理完干预后再次校验状态
- self._recalculate_all_statuses(state)
- self.save_session_to_disk(session_id)
- return res
async def continue_workflow(self, session_id: str) -> Dict:
with self._state_lock:
diff --git a/video-claw/video-claw/frontend/components/TopBar.tsx b/video-claw/video-claw/frontend/components/TopBar.tsx
index cb50952..c6e40f9 100644
--- a/video-claw/video-claw/frontend/components/TopBar.tsx
+++ b/video-claw/video-claw/frontend/components/TopBar.tsx
@@ -49,7 +49,7 @@
modelConfig?: ModelConfig;
/** 模型配置变更 */
onModelConfigChange?: (config: ModelConfig) => void;
- /** 项目状态(如 running, waiting, completed, completed, idle, error 等) */
+ /** 项目状态(如 running, waiting, completed, stopped, idle, error 等) */
projectStatus?: string;
}
diff --git a/video-claw/video-claw/frontend/components/WorkflowPanel.tsx b/video-claw/video-claw/frontend/components/WorkflowPanel.tsx
index ad7e9fb..bc95651 100644
--- a/video-claw/video-claw/frontend/components/WorkflowPanel.tsx
+++ b/video-claw/video-claw/frontend/components/WorkflowPanel.tsx
@@ -1258,7 +1258,7 @@
}
// ── 计算项目状态 ──
- // 后端状态: pending, running, waiting, completed, completed, error
+ // 后端阶段状态: pending, running, waiting, completed, stopped, error
// 前端 StageStatus: pending, running, waiting, completed, error
const hasRunning = Object.values(stageStates).some(s => s.status === 'running');
const hasWaiting = Object.values(stageStates).some(s => s.status === 'waiting');
--
Gitblit v1.8.0