Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/agentsight/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ struct JsonFullConfig {
#[serde(default)]
deadloop: Option<JsonDeadloop>,
#[serde(default)]
reactive: Option<JsonReactive>,
#[serde(default)]
cgroup_filter_enabled: Option<bool>,
#[serde(default)]
cgroup_ids: Option<Vec<u64>>,
Expand All @@ -254,6 +256,17 @@ struct JsonDeadloop {
kill_after_count: Option<usize>,
}

/// Reactive exporter 配置区段
#[derive(serde::Deserialize, Clone, Debug)]
struct JsonReactive {
#[serde(default)]
enabled: Option<bool>,
#[serde(default)]
debounce_secs: Option<u64>,
#[serde(default)]
workspace: Option<String>,
}

/// Runtime 动态配置区段(支持热加载,无需重启)
#[derive(serde::Deserialize, Clone, Debug)]
pub struct JsonRuntime {
Expand Down Expand Up @@ -502,6 +515,14 @@ pub struct AgentsightConfig {
pub deadloop_kill_enabled: bool,
/// 触发 kill 的循环次数阈值(检测到 N 次后 kill)
pub deadloop_kill_after_count: usize,

// --- Reactive Exporter Configuration ---
/// Enable the reactive exporter (observe→act pipeline)
pub reactive_enabled: Option<bool>,
/// Minimum seconds between consecutive checkpoint actions
pub reactive_debounce_secs: Option<u64>,
/// Workspace path for ws-ckpt checkpoint
pub reactive_workspace: Option<String>,
}

impl Default for AgentsightConfig {
Expand Down Expand Up @@ -562,6 +583,11 @@ impl Default for AgentsightConfig {
// DeadLoop auto-kill defaults (disabled by default)
deadloop_kill_enabled: false,
deadloop_kill_after_count: 3,

// Reactive exporter defaults (disabled by default)
reactive_enabled: None,
reactive_debounce_secs: None,
reactive_workspace: None,
}
}
}
Expand Down Expand Up @@ -703,6 +729,13 @@ impl AgentsightConfig {
}
}

// 解析 reactive exporter 配置
if let Some(ref r) = parsed.reactive {
self.reactive_enabled = r.enabled;
self.reactive_debounce_secs = r.debounce_secs;
self.reactive_workspace = r.workspace.clone();
}

// Parse cgroup filter settings
if let Some(v) = parsed.cgroup_filter_enabled {
self.cgroup_filter_enabled = v;
Expand Down
1 change: 1 addition & 0 deletions src/agentsight/src/genai/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub mod instance_id;
pub mod logtail;
pub mod encrypt;
pub mod anolisa_release;
pub mod reactive;

pub use semantic::{
GenAISemanticEvent, LLMCall, LLMRequest, LLMResponse,
Expand Down
Loading
Loading