Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(config): remove unused agent config module

Steven Enamakelc45b50ef65ae
diff --git a/crates/openhuman-core/src/config/ops/agent.rs b/crates/openhuman-core/src/config/ops/agent.rs
index e64f0873db..e44fdf9cc8 100644
--- a/crates/openhuman-core/src/config/ops/agent.rs
+++ b/crates/openhuman-core/src/config/ops/agent.rs
@@ -563,94 +563,6 @@ pub async fn get_agent_paths() -> Result<RpcOutcome<serde_json::Value>, String>
))
}
-/// Returns the current activity level and its derived settings.
-pub async fn get_activity_level_settings() -> Result<RpcOutcome<serde_json::Value>, String> {
- let config = load_config_with_timeout().await?;
- let level = config.agent_activity_level;
- let (cost_min, cost_max) = level.estimated_monthly_cost_range();
- let value = serde_json::json!({
- "level": level as u8,
- "level_label": level.as_str(),
- "sync_interval_secs": level.sync_interval_secs(),
- "heartbeat_enabled": level.heartbeat_enabled(),
- "subconscious_enabled": level.subconscious_enabled(),
- "token_budget_per_cycle": level.token_budget_per_cycle(),
- "estimated_monthly_cost_min_usd": cost_min,
- "estimated_monthly_cost_max_usd": cost_max,
- });
- Ok(RpcOutcome::single_log(
- value,
- "activity level settings read",
- ))
-}
-
-/// Updates the agent activity level and pushes it into the scheduler gate.
-pub async fn apply_activity_level_settings(
- config: &mut Config,
- update: ActivityLevelSettingsPatch,
-) -> Result<RpcOutcome<serde_json::Value>, String> {
- use crate::config::schema::activity_level::AgentActivityLevel;
- use crate::config::SchedulerGateMode;
-
- if let Some(level_str) = update.level {
- let level = AgentActivityLevel::from_str_opt(&level_str).ok_or_else(|| {
- format!(
- "invalid activity level '{}' \
- (expected off|minimal|moderate|active|always_on or 0-4)",
- level_str
- )
- })?;
- config.agent_activity_level = level;
- }
-
- let level = config.agent_activity_level;
- let gate_mode = match level {
- AgentActivityLevel::Off => SchedulerGateMode::Off,
- AgentActivityLevel::Minimal | AgentActivityLevel::Moderate => SchedulerGateMode::Auto,
- AgentActivityLevel::Active | AgentActivityLevel::AlwaysOn => SchedulerGateMode::AlwaysOn,
- };
- config.scheduler_gate.mode = gate_mode;
-
- config.save().await.map_err(|e| e.to_string())?;
-
- let gate_cfg = config.scheduler_gate.clone();
- crate::cron::scheduler_gate::gate::update_config(gate_cfg);
-
- tracing::info!(
- level = %level.as_str(),
- gate_mode = %gate_mode.as_str(),
- "[config:activity_level] activity level updated"
- );
-
- let (cost_min, cost_max) = level.estimated_monthly_cost_range();
- let value = serde_json::json!({
- "level": level as u8,
- "level_label": level.as_str(),
- "sync_interval_secs": level.sync_interval_secs(),
- "heartbeat_enabled": level.heartbeat_enabled(),
- "subconscious_enabled": level.subconscious_enabled(),
- "token_budget_per_cycle": level.token_budget_per_cycle(),
- "estimated_monthly_cost_min_usd": cost_min,
- "estimated_monthly_cost_max_usd": cost_max,
- });
- Ok(RpcOutcome::new(
- value,
- vec![format!(
- "activity level set to '{}' — saved to {}",
- level.as_str(),
- config.config_path.display()
- )],
- ))
-}
-
-/// Loads the configuration, applies activity level settings, and saves it.
-pub async fn load_and_apply_activity_level_settings(
- update: ActivityLevelSettingsPatch,
-) -> Result<RpcOutcome<serde_json::Value>, String> {
- let mut config = load_config_with_timeout().await?;
- apply_activity_level_settings(&mut config, update).await
-}
-
fn memory_sync_settings_value(stored: Option<u64>) -> serde_json::Value {
let is_manual = stored == Some(0);
let is_default = stored.is_none();