diff --git a/crates/df-nodes/src/human_node.rs b/crates/df-nodes/src/human_node.rs index c2fa11e..e1b0c51 100644 --- a/crates/df-nodes/src/human_node.rs +++ b/crates/df-nodes/src/human_node.rs @@ -38,13 +38,16 @@ impl Node for HumanNode { let mut rx = ctx.event_bus.subscribe(); // 2. 发送人工审批请求到事件总线 - let _ = ctx.event_bus.send(WorkflowEvent::HumanApprovalRequest { - execution_id: ctx.execution_id.clone(), - node_id: ctx.node_id.clone(), - title: title.to_string(), - description: description.to_string(), - options: options.clone(), - }); + // send 是 async fn(broadcast 同步发但 async 包装),必须 await 否则 Future 不 poll、Request 不进 channel(B-03b-R6) + let _ = ctx.event_bus + .send(WorkflowEvent::HumanApprovalRequest { + execution_id: ctx.execution_id.clone(), + node_id: ctx.node_id.clone(), + title: title.to_string(), + description: description.to_string(), + options: options.clone(), + }) + .await; // 3. select! 循环:Response / 超时 / 取消 let deadline = tokio::time::Instant::now() + Duration::from_secs(timeout_secs); diff --git a/src/stores/project.ts b/src/stores/project.ts index a52df9e..e6c6990 100644 --- a/src/stores/project.ts +++ b/src/stores/project.ts @@ -211,8 +211,9 @@ function createStore() { try { state.liveEvents.push(payload) // 处理人工审批请求 - if (payload.event?.type === 'HumanApprovalRequest') { - state.pendingApproval = payload.event.data as typeof state.pendingApproval + // WorkflowEvent serde tag=type rename_all=snake_case → type='human_approval_request',字段扁平(无 data 包装)(B-03b-R7) + if (payload.event?.type === 'human_approval_request') { + state.pendingApproval = payload.event as unknown as typeof state.pendingApproval } } catch (e) { console.error('处理工作流事件失败:', e, payload)