feat(agent): 实现 ContextSlot fork/merge
- 新增 MergeStrategy 枚举(#[non_exhaustive],为 Phase 16 Summarize 预留) - 新增 ContextSlot::fork() 从父 slot 派生独立子 slot(Full / Focused 策略) - 新增 ContextSlot::merge() 将子 slot 消息合入父 slot(Append / Replace 策略) - 防御性检查:禁止 self-merge、跨 session merge、合并到 Readonly slot - 重构 AgentSession::derive_slot 复用 fork() 消除重复代码 - 新增 9 个内联测试覆盖 fork/merge happy path 与 error path - agent.rs 追加 MergeStrategy re-export(agcore::agent::MergeStrategy 路径可用)
This commit is contained in:
+2
-2
@@ -22,8 +22,8 @@ pub mod task;
|
||||
pub use agent::Agent;
|
||||
pub use builder::AgentBuilder;
|
||||
pub use context::{
|
||||
ContextBudget, ContextSlot, DeriveStrategy, FocusedConfig, SlotConfig, SlotMeta, SlotMode,
|
||||
SlotSource,
|
||||
ContextBudget, ContextSlot, DeriveStrategy, FocusedConfig, MergeStrategy, SlotConfig,
|
||||
SlotMeta, SlotMode, SlotSource,
|
||||
};
|
||||
pub use error::AgentError;
|
||||
pub use runtime::{AgentConfig, RuntimeBundle};
|
||||
|
||||
Reference in New Issue
Block a user