Skip to main content

Module context

Module context 

Source
Expand description

会话的配置与状态,按读写性质拆开,而不是一个什么都装的上下文对象:

  • 只读配置 → Arc<EngineConfig>
  • 可变运行期 → Arc<dyn Session>(内部按需 split lock)

Re-exports§

pub use self::config::*;
pub use self::ledger::*;
pub use self::session::*;
pub use self::task::*;

Modules§

config
引擎只读配置 + 模型窗口推断。
goal
Session goals: an objective the engine keeps working on across turns, one automatic round at a time, until the model marks it complete or blocked or its rounds or its token budget run out.
ledger
What a session has spent and asked for over its turns — kept on its SessionState (in session-state), so it outlives the engine that ran them. Its token total is also in the session log (agix.spend), so it outlives the process.
session
会话状态的契约:引擎从设置推出来的 SessionEnv、写进会话日志的 DurableState、 工具与策略经 Arc<dyn Session> 看到的 Session trait,以及绑定任务生命周期的 TaskScope / TaskLease。实现在 session-state crate,是这个 trait 唯一的实现。
task
后台任务 + todo 条目类型。