Skip to main content

observer_for_config

Function observer_for_config 

Source
pub fn observer_for_config(config: &Config) -> Option<Arc<CheckpointObserver>>
Expand description

Build the CheckpointObserver a fresh crate::Agent should install, given a resolved crate::Config — called once, from crate::agent::build_tool_context. Config::checkpoint_enabled is the ONE gate: false (the default) returns None WITHOUT touching the filesystem at all (no CheckpointStore::open, no directory created) — the default-off byte-identity guarantee. true opens (creating if needed) the shadow store at Config::checkpoint_dir, or default_shadow_root when that’s unset; an I/O failure (unwritable state dir) is reported via a one-time eprintln! warning and returns None — graceful degrade, never a crash, never a blocked Agent::new.