Skip to content

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

chore(inference): remove should_react function and its wiring

Steven Enamakel7f02c94b3244
diff --git a/crates/openhuman-core/src/inference/ops.rs b/crates/openhuman-core/src/inference/ops.rs
index f5085b7902..6d10aa967e 100644
--- a/crates/openhuman-core/src/inference/ops.rs
+++ b/crates/openhuman-core/src/inference/ops.rs
@@ -5,7 +5,6 @@ use crate::config::rpc as config_rpc;
use crate::config::Config;
use crate::core::Outcome;
use crate::inference::host_runtime as local_runtime;
-use crate::inference::host_runtime::ops::ReactionDecision;
use crate::inference::provider as providers;
use crate::inference::{LocalAiEmbeddingResult, LocalAiStatus};
use serde_json::{json, Value};
@@ -215,26 +214,6 @@ pub async fn inference_test_provider_model(
result
}
-pub async fn inference_should_react(
- config: &Config,
- message: &str,
- channel_type: &str,
-) -> Result<Outcome<ReactionDecision>, String> {
- debug!(
- message_len = message.len(),
- channel_type, "{LOG_PREFIX} should_react:start"
- );
- let result = local_runtime::rpc::local_ai_should_react(config, message, channel_type).await;
- match &result {
- Ok(outcome) => debug!(
- should_react = outcome.value.should_react,
- "{LOG_PREFIX} should_react:ok"
- ),
- Err(err) => warn!(error = %err, "{LOG_PREFIX} should_react:error"),
- }
- result
-}
-
pub async fn inference_analyze_sentiment(
config: &Config,
message: &str,
diff --git a/crates/openhuman-core/src/inference/ops_tests.rs b/crates/openhuman-core/src/inference/ops_tests.rs
index cb7ba314e8..b6a7ef8554 100644
--- a/crates/openhuman-core/src/inference/ops_tests.rs
+++ b/crates/openhuman-core/src/inference/ops_tests.rs
@@ -132,16 +132,6 @@ fn inference_test_provider_model_keeps_unexpected_errors_reportable() {
);
}
-#[tokio::test]
-async fn inference_should_react_short_circuits_for_empty_message() {
- let (config, _tmp) = disabled_config();
- let outcome = inference_should_react(&config, " ", "web")
- .await
- .expect("reaction decision");
- assert!(!outcome.value.should_react);
- assert!(outcome.value.emoji.is_none());
-}
-
#[tokio::test]
async fn inference_analyze_sentiment_handles_empty_message() {
let (config, _tmp) = disabled_config();
diff --git a/crates/openhuman-core/src/inference/schemas.rs b/crates/openhuman-core/src/inference/schemas.rs
index 4c1e948a74..58505897a7 100644
--- a/crates/openhuman-core/src/inference/schemas.rs
+++ b/crates/openhuman-core/src/inference/schemas.rs
@@ -55,7 +55,6 @@ pub fn all_controller_schemas() -> Vec<ControllerSchema> {
schemas("prompt"),
schemas("vision_prompt"),
schemas("test_provider_model"),
- schemas("should_react"),
schemas("analyze_sentiment"),
schemas("claude_code_status"),
schemas("claude_code_auth_status"),
@@ -146,10 +145,6 @@ pub fn all_registered_controllers() -> Vec<RegisteredController> {
schema: schemas("test_provider_model"),
handler: handle_inference_test_provider_model,
},
- RegisteredController {
- schema: schemas("should_react"),
- handler: handle_inference_should_react,
- },
RegisteredController {
schema: schemas("analyze_sentiment"),
handler: handle_inference_analyze_sentiment,
diff --git a/crates/openhuman-core/src/inference/schemas/catalog.rs b/crates/openhuman-core/src/inference/schemas/catalog.rs
index 50e48e1f3c..0ca78a7d11 100644
--- a/crates/openhuman-core/src/inference/schemas/catalog.rs
+++ b/crates/openhuman-core/src/inference/schemas/catalog.rs
@@ -219,16 +219,6 @@ pub fn schemas(function: &str) -> ControllerSchema {
],
outputs: vec![json_output("reply", "Assistant reply text.")],
},
- "should_react" => ControllerSchema {
- namespace: "inference",
- function: "should_react",
- description: "Ask the inference provider whether the assistant should add an emoji reaction to a user message, based on channel type.",
- inputs: vec![
- required_string("message", "User message content to evaluate."),
- required_string("channel_type", "Channel type: web, telegram, discord, slack, etc."),
- ],
- outputs: vec![json_output("decision", "Reaction decision: {should_react, emoji}.")],
- },
"analyze_sentiment" => ControllerSchema {
namespace: "inference",
function: "analyze_sentiment",
diff --git a/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs b/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
index 5a4ab4a543..eff8733a11 100644
--- a/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
+++ b/crates/openhuman-core/src/inference/schemas/prompt_handlers.rs
@@ -35,12 +35,6 @@ pub(super) struct InferenceTestChatModelParams {
prompt: Option<String>,
}
-#[derive(Debug, Deserialize)]
-pub(super) struct InferenceShouldReactParams {
- message: String,
- channel_type: String,
-}
-
#[derive(Debug, Deserialize)]
pub(super) struct InferenceAnalyzeSentimentParams {
message: String,
@@ -97,17 +91,6 @@ pub(super) fn handle_inference_test_provider_model(params: Map<String, Value>) -
})
}
-pub(super) fn handle_inference_should_react(params: Map<String, Value>) -> ControllerFuture {
- Box::pin(async move {
- let p = deserialize_params::<InferenceShouldReactParams>(params)?;
- let config = config_rpc::load_config_with_timeout().await?;
- to_json(
- crate::inference::rpc::inference_should_react(&config, &p.message, &p.channel_type)
- .await?,
- )
- })
-}
-
pub(super) fn handle_inference_analyze_sentiment(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
let p = deserialize_params::<InferenceAnalyzeSentimentParams>(params)?;