Skip to content

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

chore: files changed tests/json_rpc_e2e.rs,evidence/issue75/native-host-e2e-scoped-calls.after,evide

Steven Enamakel61d7991f773d
diff --git a/evidence/issue75/native-host-e2e-scoped-calls.after b/evidence/issue75/native-host-e2e-scoped-calls.after
new file mode 100644
index 0000000000..e7d39e7098
--- /dev/null
+++ b/evidence/issue75/native-host-e2e-scoped-calls.after
@@ -0,0 +1 @@
+ed30c16fdac32a8d1afe36485c4b62d970c970ad
diff --git a/evidence/issue75/native-host-e2e-scoped-calls.before b/evidence/issue75/native-host-e2e-scoped-calls.before
new file mode 100644
index 0000000000..e7d39e7098
--- /dev/null
+++ b/evidence/issue75/native-host-e2e-scoped-calls.before
@@ -0,0 +1 @@
+ed30c16fdac32a8d1afe36485c4b62d970c970ad
diff --git a/evidence/issue75/native-host-e2e-scoped-calls.exit b/evidence/issue75/native-host-e2e-scoped-calls.exit
new file mode 100644
index 0000000000..398050c62c
--- /dev/null
+++ b/evidence/issue75/native-host-e2e-scoped-calls.exit
@@ -0,0 +1 @@
+101
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rs
index f22cf5b158..e7589fc21d 100644
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@ -3160,8 +3160,11 @@ async fn json_rpc_cron_manual_worker_survives_caller_cancel_on_published_tinyflo
let first_job_id = first_job.id.clone();
let first_context = Arc::clone(&default_context);
let first = tokio::spawn(async move {
- let dispatch = DispatchCtx::new(first_context);
- openhuman_core::cron::ops::run_job_now(&dispatch, &first_config, &first_job_id).await
+ let dispatch = DispatchCtx::new(Arc::clone(&first_context));
+ CoreContext::scope(first_context, async move {
+ openhuman_core::cron::ops::run_job_now(&dispatch, &first_config, &first_job_id).await
+ })
+ .await
});
tokio::time::timeout(Duration::from_secs(10), scope_started_rx.recv())
.await
@@ -3173,11 +3176,16 @@ async fn json_rpc_cron_manual_worker_survives_caller_cancel_on_published_tinyflo
"cancel the core's synchronous Run Now waiter while its module worker remains active"
);
- let duplicate = openhuman_core::cron::ops::run_job_now(
- &DispatchCtx::new(Arc::clone(&default_context)),
- &config,
- &first_job.id,
- )
+ let duplicate_context = Arc::clone(&default_context);
+ let duplicate_job_id = first_job.id.clone();
+ let duplicate = CoreContext::scope(Arc::clone(&duplicate_context), async move {
+ openhuman_core::cron::ops::run_job_now(
+ &DispatchCtx::new(Arc::clone(&duplicate_context)),
+ &config,
+ &duplicate_job_id,
+ )
+ .await
+ })
.await;
let refusal = match duplicate {
Err(error) => error,
@@ -3193,8 +3201,11 @@ async fn json_rpc_cron_manual_worker_survives_caller_cancel_on_published_tinyflo
let second_job_id = second_job.id.clone();
let second_context = Arc::clone(&agent_context);
let mut second = tokio::spawn(async move {
- let dispatch = DispatchCtx::new(second_context);
- openhuman_core::cron::ops::run_job_now(&dispatch, &second_config, &second_job_id).await
+ let dispatch = DispatchCtx::new(Arc::clone(&second_context));
+ CoreContext::scope(second_context, async move {
+ openhuman_core::cron::ops::run_job_now(&dispatch, &second_config, &second_job_id).await
+ })
+ .await
});
tokio::select! {
result = &mut second => panic!(