Skip to content

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

test: use explicit parent context in subagent fixtures

Steven Enamakel3396f5d67248
diff --git a/tests/composio_list_tools_stack_overflow_regression.rs b/tests/composio_list_tools_stack_overflow_regression.rs
index 1dba34f2cb..9dc832dd10 100644
--- a/tests/composio_list_tools_stack_overflow_regression.rs
+++ b/tests/composio_list_tools_stack_overflow_regression.rs
@@ -109,14 +109,16 @@
use async_trait::async_trait;
use openhuman_core::agent::harness::host_definition::AgentDefinitionRegistry;
-use openhuman_core::agent::harness::{with_parent_context, ParentExecutionContext};
-use openhuman_core::agent::subagent_host::{run_subagent, SubagentRunOptions};
+use openhuman_core::agent::harness::ParentExecutionContext;
+use openhuman_core::agent::subagent_host::{run_subagent_with_parent, SubagentRunOptions};
+use openhuman_core::agent::tinyagents::host::OpenHumanRunContext;
use openhuman_core::config::AgentConfig;
use parking_lot::Mutex;
use serde_json::json;
use std::sync::Arc;
use tempfile::tempdir;
use tinyagents_definition::ModelSpec;
+use tinyagents_harness::context::{RunConfig, RunContext};
use tinyinference_llm::message::AssistantMessage;
use tinyinference_llm::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};
use tinyinference_llm::tool::ToolCall;
@@ -351,13 +353,14 @@ async fn drive_subagent() {
// stack the cargo-test process aborts (SIGABRT / SIGBUS) and no
// test report is emitted. We don't care whether the sub-agent
// semantically "succeeded" — only that the runtime did not abort.
- let _ = with_parent_context(parent, async move {
- run_subagent(
- &def,
- "list available gmail actions",
- SubagentRunOptions::default(),
- )
- .await
- })
+ let mut run_data = OpenHumanRunContext::new();
+ run_data.parent = Some(parent);
+ let run_context = RunContext::new(RunConfig::new("stack-regression-parent"), run_data);
+ let _ = run_subagent_with_parent(
+ &run_context,
+ def,
+ "list available gmail actions",
+ SubagentRunOptions::default(),
+ )
.await;
}
diff --git a/tests/in_process/calendar_grounding_e2e.rs b/tests/in_process/calendar_grounding_e2e.rs
index 2b42630a01..2e575647f6 100644
--- a/tests/in_process/calendar_grounding_e2e.rs
+++ b/tests/in_process/calendar_grounding_e2e.rs
@@ -212,14 +212,18 @@ async fn test_subagent_has_current_date_context() -> Result<()> {
// `subagent_runner::ops::tests::resolve_subagent_provider_*`.
def.model = tinyagents_definition::ModelSpec::Inherit;
- let _ = openhuman_core::agent::harness::with_parent_context(parent, async {
- openhuman_core::agent::subagent_host::run_subagent(
- &def,
- "list my calendar events for today",
- openhuman_core::agent::subagent_host::SubagentRunOptions::default(),
- )
- .await
- })
+ let mut run_data = openhuman_core::agent::tinyagents::host::OpenHumanRunContext::new();
+ run_data.parent = Some(parent);
+ let run_context = tinyagents_harness::context::RunContext::new(
+ tinyagents_harness::context::RunConfig::new("calendar-grounding-parent"),
+ run_data,
+ );
+ let _ = openhuman_core::agent::subagent_host::run_subagent_with_parent(
+ &run_context,
+ def,
+ "list my calendar events for today",
+ openhuman_core::agent::subagent_host::SubagentRunOptions::default(),
+ )
.await?;
let messages = captured_messages.lock();