Skip to content

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

fix(cost): ignore the process-wide tracker rebind in SaaS mode

Steven Enamakele380febae77b
diff --git a/crates/openhuman-core/src/platform/cost/global.rs b/crates/openhuman-core/src/platform/cost/global.rs
index 2d83bb84e1..798ca791c9 100644
--- a/crates/openhuman-core/src/platform/cost/global.rs
+++ b/crates/openhuman-core/src/platform/cost/global.rs
@@ -92,6 +92,12 @@ pub fn init_global(config: CostConfig, workspace_dir: &Path) {
/// figures start over with the new tracker. A failed construction keeps the
/// previous tracker rather than leaving the process with none.
pub fn rebind_global(config: CostConfig, workspace_dir: &Path) {
+ // In SaaS every profile owns its tracker (see `seed_tenant_tracker`); the
+ // process-wide slot is never read, so rebinding it would only mislead.
+ if crate::core::runtime::is_saas() {
+ log::debug!("[cost] rebind_global ignored in SaaS mode");
+ return;
+ }
if let Some(current) = try_global() {
if current.workspace_dir() == workspace_dir {
log::debug!(