Skip to content

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

refactor(profiles): drop cron admission reconciliation from profile access

Steven Enamakel743f7b7c24ac
diff --git a/crates/openhuman-core/src/cron/limits.rs b/crates/openhuman-core/src/cron/limits.rs
index e8e481bd65..424fceba60 100644
--- a/crates/openhuman-core/src/cron/limits.rs
+++ b/crates/openhuman-core/src/cron/limits.rs
@@ -62,8 +62,8 @@ fn install_capacity_limit(config: &Config) -> Result<()> {
}
/// Clear a prior operator cap when enforcement is off. Backends without
-/// transactions could never install one, so they remain compatible without
-/// attempting an unsupported `SetMaxActiveJobs(None)` write.
+/// transactions cannot clear it, so skip the unsupported write; TinyFlows'
+/// admission ledger guard refuses mutations if an earlier policy is present.
fn clear_capacity_limit_if_supported(config: &Config) -> Result<()> {
let scope = super::documents_port::DocScope::current(config)?;
if !scope.supports_transactions()? {
diff --git a/crates/openhuman-core/src/profiles/host.rs b/crates/openhuman-core/src/profiles/host.rs
index 9a1631171e..4c1154e4e2 100644
--- a/crates/openhuman-core/src/profiles/host.rs
+++ b/crates/openhuman-core/src/profiles/host.rs
@@ -250,9 +250,7 @@ impl ProfileHost {
if self.registry.get(id).await?.is_none() {
return Err(format!("profile {id} is not provisioned"));
}
- let config = self.serving_config(&self.layout_of(id), id)?;
- super::lifecycle::reconcile_cron_admission(&config, id).await?;
- Ok(config)
+ self.serving_config(&self.layout_of(id), id)
}
/// Profile `id`, opening it — and taking its lease — if it is provisioned
diff --git a/crates/openhuman-core/src/profiles/lifecycle.rs b/crates/openhuman-core/src/profiles/lifecycle.rs
index 986c72b07f..10e5d4e824 100644
--- a/crates/openhuman-core/src/profiles/lifecycle.rs
+++ b/crates/openhuman-core/src/profiles/lifecycle.rs
@@ -122,22 +122,6 @@ impl ProfileHost {
pub async fn provision(&self, id: &ProfileId) -> Result<bool, String> {
let _profile = self.lifecycle.lock(id).await;
if self.registry.get(id).await?.is_some() {
- let grant = self.acquire_for_lifecycle(id, "provision").await?;
- match self.registry.get(id).await {
- Ok(Some(_)) => {}
- Ok(None) => {
- profile_lease::release_all(self, vec![(id.clone(), grant)]).await;
- return Ok(false);
- }
- Err(error) => {
- profile_lease::release_all(self, vec![(id.clone(), grant)]).await;
- return Err(error);
- }
- }
- let config = self.forced_config(&self.layout_of(id), id);
- let reconciled = reconcile_cron_admission(&config, id).await;
- profile_lease::release_all(self, vec![(id.clone(), grant)]).await;
- reconciled?;
log::debug!("[profiles] provision profile={id}: already provisioned");
return Ok(false);
}