Skip to content

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

fix(agent): import spawn depth in runner tests

Steven Enamakel90ff85e2a015
diff --git a/crates/openhuman-core/src/agent/harness/mod.rs b/crates/openhuman-core/src/agent/harness/mod.rs
index d0569d9b74..2b3a8f5ba7 100644
--- a/crates/openhuman-core/src/agent/harness/mod.rs
+++ b/crates/openhuman-core/src/agent/harness/mod.rs
@@ -37,7 +37,7 @@ pub(crate) mod required_output;
pub mod run_queue;
pub mod sandbox_context;
pub mod session;
-mod spawn_depth_context;
+pub(crate) mod spawn_depth_context;
pub mod subagent_runner;
pub mod task_recency_context;
pub(crate) mod tool_result_artifacts;
@@ -55,8 +55,6 @@ pub use fork_context::{
with_parent_context, AgentContextPreparedSource, ParentExecutionContext,
};
pub use sandbox_context::{current_sandbox_mode, with_current_sandbox_mode};
-#[cfg(test)]
-pub(crate) use spawn_depth_context::current_spawn_depth;
pub(crate) use spawn_depth_context::{with_spawn_depth, MAX_SPAWN_DEPTH};
pub use subagent_runner::{run_subagent, SubagentRunError, SubagentRunOptions};
pub use task_recency_context::{current_task_recency_window, with_task_recency_window};
diff --git a/crates/openhuman-core/src/agent/harness/spawn_depth_context_tests.rs b/crates/openhuman-core/src/agent/harness/spawn_depth_context_tests.rs
index 51f8036ab1..365a08da32 100644
--- a/crates/openhuman-core/src/agent/harness/spawn_depth_context_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/spawn_depth_context_tests.rs
@@ -1,3 +1,4 @@
+use super::spawn_depth_context::current_spawn_depth;
use super::*;
#[tokio::test]
diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_model_resolution_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_model_resolution_tests.rs
index be63bcc939..5989c960c3 100644
--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_model_resolution_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_model_resolution_tests.rs
@@ -1,4 +1,5 @@
use super::*;
+use crate::agent::harness::spawn_depth_context::current_spawn_depth;
#[tokio::test]
async fn runner_rejects_spawn_beyond_max_depth() {
diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs
index 8181b22360..bb8d08fa7a 100644
--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests_slug_filter_typed_mode_tests.rs
@@ -1,4 +1,5 @@
use super::*;
+use crate::agent::harness::spawn_depth_context::current_spawn_depth;
#[test]
fn lazy_resolver_tolerates_near_miss_slugs() {
diff --git a/scripts/ci/agent-runtime-boundary-baseline.json b/scripts/ci/agent-runtime-boundary-baseline.json
index d08052158c..9c83def624 100644
--- a/scripts/ci/agent-runtime-boundary-baseline.json
+++ b/scripts/ci/agent-runtime-boundary-baseline.json
@@ -234,7 +234,7 @@
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/agent/harness/mod.rs",
"line": 40,
- "text": "mod spawn_depth_context;",
+ "text": "pub(crate) mod spawn_depth_context;",
"occurrence": 1
},
{
@@ -254,21 +254,14 @@
{
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/agent/harness/mod.rs",
- "line": 59,
- "text": "pub(crate) use spawn_depth_context::current_spawn_depth;",
- "occurrence": 1
- },
- {
- "rule": "openhuman-task-local",
- "path": "crates/openhuman-core/src/agent/harness/mod.rs",
- "line": 60,
+ "line": 58,
"text": "pub(crate) use spawn_depth_context::{with_spawn_depth, MAX_SPAWN_DEPTH};",
"occurrence": 1
},
{
"rule": "openhuman-task-local",
"path": "crates/openhuman-core/src/agent/harness/mod.rs",
- "line": 62,
+ "line": 60,
"text": "pub use task_recency_context::{current_task_recency_window, with_task_recency_window};",
"occurrence": 1
},