Skip to content

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

chore: files changed crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs

Steven Enamakel3cd452b799fe
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs b/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs
index cd353bd54f..8b03196d3c 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops/reactions.rs
@@ -62,13 +62,18 @@ pub async fn local_ai_should_react(
);
let runtime = crate::inference::local_runtime_config(config);
- let Some(_permit) = crate::cron::scheduler_gate::wait_for_capacity().await else {
+ // A reaction decorates a reply that is waiting to be delivered, so it may
+ // only use the local model when the gate would admit it *now*. Waiting
+ // here (`wait_for_capacity`) parks forever while background AI is paused
+ // and, with it, the reply's `chat_done`.
+ let Some(_permit) = crate::cron::scheduler_gate::try_capacity_now() else {
+ tracing::debug!("[local_ai:should_react] scheduler gate has no capacity now, skipping");
return Ok(Outcome::single_log(
ReactionDecision {
should_react: false,
emoji: None,
},
- "local inference paused while signed out",
+ "local inference unavailable right now",
));
};
let output = service.prompt(&runtime, &prompt, Some(8), true).await;