From cf7fe867ee6adcb590577d6be82970a22b195cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Mon, 22 Jun 2026 01:24:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=20aichat=20B=E8=B7=AF?= =?UTF-8?q?=E7=BA=BFPhase1=E8=A7=84=E5=88=92=E5=BC=80=E5=85=B3=E5=90=AF?= =?UTF-8?q?=E7=94=A8(PLANNING=5FENABLED=3Dtrue)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主loop走filter_tool_defs_planned规划(agentic/mod.rs:633接入点就绪) 双层开关可回退:PLANNING_ENABLED(主loop)+PLAN_HINT_ENABLED(plan_hint函数) 任一关闭退扁平旧行为;feature_flags_default_on测试断言同步 --- crates/df-ai/src/planner.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/df-ai/src/planner.rs b/crates/df-ai/src/planner.rs index c987a21..6735eee 100644 --- a/crates/df-ai/src/planner.rs +++ b/crates/df-ai/src/planner.rs @@ -26,13 +26,15 @@ // ---- feature flag 占位 ------------------------------------------------------ -/// 规划能力总开关(Phase 1 接入用占位)。 +/// 规划能力总开关(主 loop 规划开关,门控 filter_tool_defs_planned 接入)。 /// -/// **当前恒 `false`** = 单链 ReAct 旧行为(主 loop 未走 Plan 规划)。 -/// Phase 1(plan_hint 接入主 loop)落地时翻为 `true` + 条件编译门控。 +/// **当前 `true`** = 主 loop 走 Plan 规划(agentic/mod.rs:633 调 filter_tool_defs_planned)。 +/// Phase 1(plan_hint 接入主 loop)已落地,翻 true 启用。 /// 注:`PLAN_HINT_ENABLED`(plan_hint 函数 flag,Phase0a 就绪 true)单一定义在 `plan_hint.rs`, /// 本模块仅 `PLANNING_ENABLED`(主 loop 规划开关),消除此前双定义矛盾。 -pub const PLANNING_ENABLED: bool = false; +/// 双层开关:即使 PLANNING_ENABLED=true,若 plan_hint 内部 PLAN_HINT_ENABLED 关闭, +/// filter_tool_defs_planned 仍退扁平(任一关闭退旧行为,可回退)。 +pub const PLANNING_ENABLED: bool = true; /// Plan 层级硬上限(防爆深,防规划 LLM 退化成超长链)。 /// @@ -632,10 +634,10 @@ mod tests { } #[test] - fn feature_flags_default_off() { - // PLANNING_ENABLED 当前关(主 loop 未走规划),Phase 1 接入时翻 true。 + fn feature_flags_default_on() { + // PLANNING_ENABLED 当前开(主 loop 走 filter_tool_defs_planned 规划),Phase 1 已落地。 // PLAN_HINT_ENABLED(plan_hint 函数 flag)在 plan_hint.rs 单一定义,此处不再断言。 - assert!(!PLANNING_ENABLED); + assert!(PLANNING_ENABLED); } #[test]