重构: 巨函数拆分 + 清理历史标记注释 + custom_prompt/停止按钮/tunnel 改进

This commit is contained in:
lxy
2026-07-31 21:36:12 +08:00
parent 365af554da
commit bd9031d35d
73 changed files with 1421 additions and 1064 deletions
+20 -20
View File
@@ -98,27 +98,27 @@ impl DagExecutor {
let mut any_edge_passed = false; // 任一入边放行(含无条件边)
if let Some(preds) = adjacency_in.get(node_id) {
for (pred_id, cond) in preds {
if let Some(out) = outputs.get(pred_id) {
if eval_conditions {
if let Some(cond) = cond {
has_any_cond_edge = true;
// 以 source output.data 为 context 求值;失败保守 false
let passed = ConditionEngine::evaluate(cond, &out.data)
.unwrap_or(false);
if passed {
inputs.insert(pred_id.clone(), out.clone());
any_edge_passed = true;
}
} else {
// 无 condition 的入边:无条件放行(必收集)
inputs.insert(pred_id.clone(), out.clone());
any_edge_passed = true;
}
} else {
// flag 关:condition 完全忽略,旧行为全收集
inputs.insert(pred_id.clone(), out.clone());
any_edge_passed = true;
let Some(out) = outputs.get(pred_id) else {
continue;
};
// flag 关:condition 完全忽略,旧行为全收集;
// flag 开 + 无 condition 入边:无条件放行(必收集);
// flag 开 + 有 condition 入边:以 source output.data 为 context 求值,
// 失败保守 false(对齐引擎语义)。
let passed = match (eval_conditions, cond) {
(false, _) => true,
(true, None) => true,
(true, Some(c)) => {
ConditionEngine::evaluate(c, &out.data).unwrap_or(false)
}
};
if eval_conditions && cond.is_some() {
has_any_cond_edge = true;
}
if passed {
inputs.insert(pred_id.clone(), out.clone());
any_edge_passed = true;
}
}
} else {