Skip to content

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

fix(profiles): release background completion workspace on profile lease release

Steven Enamakel6d8b68c004a6
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions.rs b/crates/openhuman-core/src/agent/orchestration/background_completions.rs
index f5701695c9..0f913193c1 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions.rs
@@ -30,7 +30,7 @@ pub(crate) use parent_lifecycle::{
clear_all, delete_parent_for_thread, discard_for_thread, discard_pending_for_thread,
finish_stop_for_thread, mark_stopped_task_if_thread_stopped, resume_stopped_thread,
};
-pub(crate) use store_adapter::router_for_workspace_ctx;
+pub(crate) use store_adapter::{release_profile_workspace, router_for_workspace_ctx};
pub(super) use store_adapter::{
degrade_to_memory, entry_for_ctx, open_driver_store, router_pool, router_scope_for,
};
diff --git a/crates/openhuman-core/src/profiles/lease.rs b/crates/openhuman-core/src/profiles/lease.rs
index 48b4a2ed39..8dd3a58e5b 100644
--- a/crates/openhuman-core/src/profiles/lease.rs
+++ b/crates/openhuman-core/src/profiles/lease.rs
@@ -138,6 +138,10 @@ pub(crate) fn release_profile_stores(host: &ProfileHost, id: &ProfileId) {
crate::storage::sessions::release_profile(id.as_str());
let workspace = host.layout_of(id).workspace_dir;
crate::storage::sessions::release_workspace(&workspace);
+ crate::agent::orchestration::background_completions::release_profile_workspace(
+ id.as_str(),
+ &workspace,
+ );
}
/// What one renewal pass did.