Skip to content

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

refactor(tokenjuice): use scoped spawn_blocking for artifact reads

Steven Enamakel1edac310182d
diff --git a/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs b/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs
index f46abb363b..e65415e278 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs
@@ -300,7 +300,7 @@ impl ModuleReplTool {
);
return Ok(ToolResult::error(not_a_handle_message()));
};
- let read = tokio::task::spawn_blocking(move || {
+ let read = crate::core::runtime::spawn_blocking_scoped(move || {
read_tool_result_artifact(&dir, &path, MAX_ARTIFACT_BYTES)
})
.await
diff --git a/scripts/ci/saas-ambient-baseline.json b/scripts/ci/saas-ambient-baseline.json
index c133eb4d14..716f00a919 100644
--- a/scripts/ci/saas-ambient-baseline.json
+++ b/scripts/ci/saas-ambient-baseline.json
@@ -72,14 +72,14 @@
{
"rule": "bare-spawn",
"path": "crates/openhuman-core/src/agent/session_host/runtime_session.rs",
- "line": 728,
+ "line": 723,
"text": "tokio::spawn(async move {",
"occurrence": 1
},
{
"rule": "bare-spawn",
"path": "crates/openhuman-core/src/agent/session_host/runtime_session.rs",
- "line": 730,
+ "line": 725,
"text": "let transcript = tokio::task::spawn_blocking(move || {",
"occurrence": 1
},
@@ -184,7 +184,7 @@
{
"rule": "bare-spawn",
"path": "crates/openhuman-core/src/channels/runtime/startup/start_channels.rs",
- "line": 225,
+ "line": 370,
"text": "let provider_bridge = AbortOnDropHandle::new(tokio::spawn(async move {",
"occurrence": 1
},
@@ -604,7 +604,7 @@
{
"rule": "ambient-config",
"path": "crates/openhuman-core/src/inference/provider/ops/models/catalog_listing.rs",
- "line": 66,
+ "line": 49,
"text": "let config = crate::config::Config::load_or_init()",
"occurrence": 1
},
@@ -657,13 +657,6 @@
"text": "let config = crate::config::Config::load_or_init()",
"occurrence": 4
},
- {
- "rule": "bare-spawn",
- "path": "crates/openhuman-core/src/inference/tokenjuice/repl_tools.rs",
- "line": 303,
- "text": "let read = tokio::task::spawn_blocking(move || {",
- "occurrence": 1
- },
{
"rule": "ambient-config",
"path": "crates/openhuman-core/src/inference/tokenjuice/schemas.rs",
@@ -814,7 +807,7 @@
{
"rule": "bare-spawn",
"path": "crates/openhuman-core/src/modules/ops.rs",
- "line": 274,
+ "line": 256,
"text": "let found_on_search_path = tokio::task::spawn_blocking(move || {",
"occurrence": 1
},
@@ -1066,7 +1059,7 @@
{
"rule": "bare-spawn",
"path": "crates/openhuman-core/src/threads/ops/edit.rs",
- "line": 379,
+ "line": 363,
"text": "let result = tokio::task::spawn_blocking(move || {",
"occurrence": 1
},