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/tools/collapsed.rs

Steven Enamakel1cedfac5379b
diff --git a/crates/openhuman-core/src/cron/tools/collapsed.rs b/crates/openhuman-core/src/cron/tools/collapsed.rs
index b690235484..8f80dce54a 100644
--- a/crates/openhuman-core/src/cron/tools/collapsed.rs
+++ b/crates/openhuman-core/src/cron/tools/collapsed.rs
@@ -120,7 +120,70 @@ impl Tool for CronTool {
`remove`, `run` (force-run now), `runs` (recent run history). \
Schedules use the device-local timezone unless `tz` is set; the \
scheduler polls on an interval and does not catch up missed runs. \
- For agent jobs, when the current turn carries a `[Channel context]` \
+ For agent jobs, a job created inside a conversation sends each run's \
+ reply back to that conversation automatically; do not set `delivery` \
+ or copy a reply target for that. Only set `delivery` to override it \
+ (`proactive` for an in-app notification, `none` for silent). A job \
+ created with no conversation defaults to `proactive`."
+ }
+
+ fn parameters_schema(&self) -> Value {
+ merge_action_schemas(&self.actions())
+ }
+
+ fn permission_level(&self) -> PermissionLevel {
+ strictest_permission(&self.actions())
+ }
+
+ fn permission_level_with_args(&self, args: &Value) -> PermissionLevel {
+ // The honest answer, once the action is known. Falls back to the
+ // strictest when the action is missing or unrecognised — such a call is
+ // about to be rejected anyway, and answering `None` for it would let an
+ // unparseable call past a gate that a parseable one would not clear.
+ let actions = self.actions();
+ args.get("action")
+ .and_then(Value::as_str)
+ .and_then(|action| resolve(&actions, action))
+ .map(|entry| entry.tool.permission_level_with_args(args))
+ .unwrap_or_else(|| strictest_permission(&actions))
+ }
+
+ fn external_effect(&self) -> bool {
+ any_external_effect(&self.actions())
+ }
+
+ fn external_effect_with_args(&self, args: &Value) -> bool {
+ let actions = self.actions();
+ args.get("action")
+ .and_then(Value::as_str)
+ .and_then(|action| resolve(&actions, action))
+ .map(|entry| entry.tool.external_effect_with_args(args))
+ .unwrap_or(true)
+ }
+
+ fn supports_markdown(&self) -> bool {
+ true
+ }
+
+ async fn execute(&self, args: Value) -> anyhow::Result<ToolResult> {
+ self.execute_with_options(args, ToolCallOptions::default())
+ .await
+ }
+
+ async fn execute_with_options(
+ &self,
+ args: Value,
+ options: ToolCallOptions,
+ ) -> anyhow::Result<ToolResult> {
+ self.execute_with_context(args, options, None).await
+ }
+
+ async fn execute_with_context(
+ &self,
+ args: Value,
+ options: ToolCallOptions,
+ context: Option<&dyn tinytools::ToolRunContext>,
+ ) -> anyhow::Result<ToolResult> {
block, set `delivery` to `{\"mode\": \"announce\", \"channel\": <channel>, \
\"to\": <reply target>}` so the reminder returns to that chat rather \
than the desktop."