Skip to main content

Module config_reload

Module config_reload 

Source
Expand description

Hot-reloading of the daemon’s spawn-time config.

The daemon loads ~/.leviath/config.toml once at startup and would otherwise serve that snapshot for its whole life - so a user who granted a [read_paths] path, flipped a tool permission, or changed a limit had to restart the daemon before the next lev run saw it. That is a surprising loop to be stuck in: the spawn warning tells you to edit the config, and editing it appears to do nothing.

ConfigReloader closes that gap for the config an agent reads at spawn (permissions, [read_paths], sandbox defaults, limits, taint). It reloads the file when its mtime changes, mirroring the script-provider hot-reload (leviath_runtime::script_provider), and keeps the last good config if a reload fails so an edit saved mid-keystroke never breaks a spawn.

What it deliberately does not reload is the infrastructure established once at boot: the provider registry, MCP connections, the outbound-network policy, and the telemetry sink. Those hold live connections and process-wide state; re-initializing them on a file write is a much larger change with its own failure modes. Adding a provider key or an MCP server still needs a daemon restart; see daemon.md.

Structs§

ConfigReloader
Serves the freshest spawn-time Config, reloading config.toml when it changes on disk.