Skip to content

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

fix(cron): route update command checks through shell job authorization

Steven Enamakelc974c31328ee
diff --git a/crates/openhuman-core/src/cron/scheduler.rs b/crates/openhuman-core/src/cron/scheduler.rs
index 10ca80561d..bfbc1c9665 100644
--- a/crates/openhuman-core/src/cron/scheduler.rs
+++ b/crates/openhuman-core/src/cron/scheduler.rs
@@ -12,7 +12,7 @@ mod origin_context;
mod origin_delivery;
mod retry;
mod run_record;
-mod shell_job;
+pub(crate) mod shell_job;
mod slot;
#[cfg(test)]
diff --git a/crates/openhuman-core/src/cron/tools/update.rs b/crates/openhuman-core/src/cron/tools/update.rs
index 669410b2e2..0a40e52076 100644
--- a/crates/openhuman-core/src/cron/tools/update.rs
+++ b/crates/openhuman-core/src/cron/tools/update.rs
@@ -98,10 +98,14 @@ impl Tool for CronUpdateTool {
};
if let Some(command) = &patch.command {
- if !self.security.is_command_allowed(command) {
- return Ok(ToolResult::error(format!(
- "Command blocked by security policy: {command}"
- )));
+ if let Err(reason) = super::super::scheduler::shell_job::authorize_shell_command(
+ &self.config,
+ &self.security,
+ command,
+ )
+ .await
+ {
+ return Ok(ToolResult::error(reason));
}
}