Skip to content

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

chore: files changed crates/openhuman-core/src/cron/scheduler/shell_job.rs

Steven Enamakel586935029b12
diff --git a/crates/openhuman-core/src/cron/scheduler/shell_job.rs b/crates/openhuman-core/src/cron/scheduler/shell_job.rs
index fc3c113366..ed9d939390 100644
--- a/crates/openhuman-core/src/cron/scheduler/shell_job.rs
+++ b/crates/openhuman-core/src/cron/scheduler/shell_job.rs
@@ -19,9 +19,28 @@ pub(crate) async fn authorize_shell_command(
) -> Result<(), String> {
#[cfg(feature = "modules")]
{
- let analysis = crate::modules::tinybox::analyze_command(config, command.to_owned())
+ let analysis = match crate::modules::tinybox::analyze_command(config, command.to_owned())
.await
- .map_err(|_| "Command analysis is unavailable.".to_owned())?;
+ {
+ Ok(analysis) => analysis,
+ Err(_) => {
+ #[cfg(test)]
+ {
+ // Scheduler unit tests exercise process and retry behavior
+ // without loading a native artifact. Production has no
+ // parser fallback and fails closed below.
+ security
+ .check_gated_command(command)
+ .map_err(|_| "blocked by security policy: command rejected".to_owned())?;
+ if !security.is_command_allowed(command) {
+ return Err("blocked by security policy: command not allowed".to_owned());
+ }
+ return Ok(());
+ }
+ #[cfg(not(test))]
+ return Err("Command analysis is unavailable.".to_owned());
+ }
+ };
security
.check_gated_command_analysis(&analysis)
.map_err(|_| "blocked by security policy: command rejected".to_owned())?;