The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(profiles): extract host profile helpers
Steven Enamakeldd8839867153
diff --git a/crates/openhuman-core/src/profiles/host.rs b/crates/openhuman-core/src/profiles/host.rsindex 6f006126f2..4a16323c6f 100644--- a/crates/openhuman-core/src/profiles/host.rs+++ b/crates/openhuman-core/src/profiles/host.rs@@ -211,7 +211,7 @@ impl ProfileHost {/// storage backend) resolves to that profile. For operator-plane work on/// a profile's records; it carries no policy and runs no turns.pub(crate) fn records_context(&self, id: &ProfileId) -> Arc<CoreContext> {- let config = layout::profile_config(&self.layout_of(id), id);+ let config = self.forced_config(&self.layout_of(id), id);self.operator.derive_with(ContextOverlay::new(config, user_domains(), ToolGroups::none()).without_user_skill_roots()@@ -219,13 +219,24 @@ impl ProfileHost {)}+ /// [`layout::profile_config`] plus the operator's cron limits, which no+ /// profile config can loosen.+ fn forced_config(&self, layout: &ProfileLayout, id: &ProfileId) -> Config {+ let mut config = layout::profile_config(layout, id);+ let cron = &self.saas.cron;+ config.cron.agent_jobs_only = cron.agent_jobs_only;+ config.cron.min_interval_secs = cron.min_interval_secs;+ config.cron.max_active_jobs = cron.max_active_jobs;+ config+ }+/// The forced config of provisioned profile `id`, without opening it (and/// so without taking a profile slot or its lease).pub async fn provisioned_config(&self, id: &ProfileId) -> Result<Config, String> {if self.registry.get(id).await?.is_none() {return Err(format!("profile {id} is not provisioned"));}- Ok(layout::profile_config(&self.layout_of(id), id))+ Ok(self.forced_config(&self.layout_of(id), id))}/// Profile `id`, opening it — and taking its lease — if it is provisioned@@ -299,7 +310,7 @@ impl ProfileHost {profile_lease::release_all(self, vec![(id.clone(), grant)]).await;return Err(OpenError::Storage(error));}- let mut config = layout::profile_config(&layout, id);+ let mut config = self.forced_config(&layout, id);if let Some(capabilities) = &self.capabilities {capabilities.configure(&mut config);}@@ -425,7 +436,7 @@ impl ProfileHost {async fn summarize(&self, meta: ProfileMeta) -> ProfileSummary {let id = meta.profile_id;- let config = layout::profile_config(&self.layout_of(&id), &id);+ let config = self.forced_config(&self.layout_of(&id), &id);let has_credential = CoreContext::scope(self.records_context(&id), async {super::credentials::has(&config)})