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,crates/openhuman-core/src/cro

Steven Enamakeld4eaa2429888
diff --git a/crates/openhuman-core/src/cron/tools/collapsed.rs b/crates/openhuman-core/src/cron/tools/collapsed.rs
index fa0e034b04..04fcce4c02 100644
--- a/crates/openhuman-core/src/cron/tools/collapsed.rs
+++ b/crates/openhuman-core/src/cron/tools/collapsed.rs
@@ -174,6 +174,15 @@ impl Tool for CronTool {
&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> {
let actions = self.actions();
let requested = args.get("action").and_then(Value::as_str);
@@ -183,11 +192,12 @@ impl Tool for CronTool {
)));
};
tracing::debug!(action = %entry.action, "[tool][cron] dispatch");
- // `execute_with_options` rather than `execute`, so an action whose
- // member honours `prefer_markdown` keeps doing so through the collapse.
+ // The selected member owns its context-aware dispatch and option
+ // handling. Forward the original call context unchanged, including
+ // for members that bind a core or conversation origin.
entry
.tool
- .execute_with_options(args_without_action(&args), options)
+ .execute_with_context(args_without_action(&args), options, context)
.await
}
}
diff --git a/crates/openhuman-core/src/cron/tools/collapsed_tests.rs b/crates/openhuman-core/src/cron/tools/collapsed_tests.rs
index 2e86927485..b1b8d405db 100644
--- a/crates/openhuman-core/src/cron/tools/collapsed_tests.rs
+++ b/crates/openhuman-core/src/cron/tools/collapsed_tests.rs
@@ -130,7 +130,7 @@ async fn run_uses_the_explicit_core_context_and_preserves_markdown_options() {
let result = CoreContext::scope(ambient, async {
cron.execute_with_context(
serde_json::json!({"action": "run", "job_id": job.id}),
- ToolCallOptions { prefer_markdown: true, ..Default::default() },
+ ToolCallOptions::prefer_markdown(),
Some(&context),
)
.await