pub struct HooksConfig {
pub cwd_changed: Vec<HookDef>,
pub file_changed: Option<FileChangedConfig>,
pub permission_denied: Vec<HookDef>,
pub turn_complete: Vec<HookDef>,
}Expand description
Top-level hooks configuration section.
Each sub-section corresponds to a lifecycle event. All sections default to empty (no hooks). Events fire in the order hooks are listed.
Fields§
§cwd_changed: Vec<HookDef>Hooks fired when the agent’s working directory changes via set_working_directory.
file_changed: Option<FileChangedConfig>File-change watcher configuration with associated hooks.
permission_denied: Vec<HookDef>Hooks fired when a tool execution is blocked by a RuntimeLayer::before_tool check.
Environment variables set for Command hooks:
ZEPH_DENIED_TOOL— the name of the tool that was blocked.ZEPH_DENY_REASON— human-readable reason string from the layer.
turn_complete: Vec<HookDef>Hooks fired after each agent turn completes (#3327).
Runs regardless of the [notifications] config. When a [notifications] notifier is
also configured, these hooks share its should_fire gate (respecting min_turn_duration_ms,
only_on_error, and enabled). When no notifier is configured, hooks fire on every
completed turn.
Use min_duration_ms in a wrapper script or the [notifications].min_turn_duration_ms
gate to avoid firing on trivial responses.
Environment variables set for Command hooks:
ZEPH_TURN_DURATION_MS— wall-clock duration of the turn in milliseconds.ZEPH_TURN_STATUS—"success"or"error".ZEPH_TURN_PREVIEW— redacted first ≤ 160 chars of the assistant response.ZEPH_TURN_LLM_REQUESTS— number of completed LLM round-trips this turn.
Implementations§
Trait Implementations§
Source§impl Clone for HooksConfig
impl Clone for HooksConfig
Source§fn clone(&self) -> HooksConfig
fn clone(&self) -> HooksConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more