Skip to content

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

test(cron): cover shell authorization when modules are disabled

Steven Enamakeld8c6cd321e30
diff --git a/crates/openhuman-core/src/cron/scheduler_tests.rs b/crates/openhuman-core/src/cron/scheduler_tests.rs
index 012b0200b4..f2b446089b 100644
--- a/crates/openhuman-core/src/cron/scheduler_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_tests.rs
@@ -282,6 +282,20 @@ async fn a_shell_job_runs_on_this_platform() {
);
}
+#[cfg(feature = "modules")]
+#[tokio::test]
+async fn scheduled_shell_authorization_fails_closed_when_tinybox_is_disabled() {
+ let tmp = TempDir::new().unwrap();
+ let mut config = test_config(&tmp).await;
+ config.modules.enabled = false;
+ let security =
+ SecurityPolicy::from_config(&config.autonomy, &config.workspace_dir, &config.action_dir);
+
+ let result = authorize_shell_command(&config, &security, "echo must-not-run").await;
+
+ assert_eq!(result, Err("Command analysis is unavailable.".to_owned()));
+}
+
/// A pipeline keeps the shell's own exit status, not `pipefail`'s.
///
/// Regression guard for a behaviour change review caught on this branch. Routing