Skip to content

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

fix(agent): cancel subagent jobs via workspace lookup only

Steven Enamakele87fcc94fc23
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
index a94e8ba908..b05f2f0861 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
@@ -136,22 +136,13 @@ impl SpawnAsyncSubagentTool {
let jobs = crate::core::runtime::slot_for::<
tinyagents_orchestration::subagent::SubAgentJobRegistry,
>(&dispatch);
- let cancelled = subagent_sessions::cancel_driver_job_for_observed_session(
- &store,
- &parent.workspace_dir.join(".openhuman/subagent_checkpoints"),
- &jobs,
- &session,
+ let _ = jobs;
+ let _ = running_subagents::cancel_by_session_in_workspace(
+ &dispatch,
+ &session.subagent_session_id,
&parent_session,
- parent_thread_id.as_deref(),
+ &parent.workspace_dir,
);
- if !cancelled {
- let _ = running_subagents::cancel_by_session_in_workspace(
- &dispatch,
- &session.subagent_session_id,
- &parent_session,
- &parent.workspace_dir,
- );
- }
match subagent_sessions::close_if_current(&store, &session) {
Ok(true) => {}
Ok(false) => {