diff --git a/plugins/ai_auto_response/response_planner.py b/plugins/ai_auto_response/response_planner.py index 23dce00..036e1c7 100644 --- a/plugins/ai_auto_response/response_planner.py +++ b/plugins/ai_auto_response/response_planner.py @@ -29,7 +29,11 @@ class ResponsePlanner: if trigger.get("is_question") and conversation_hints.get("has_recent_human_solver") and flow_state != "deep_engaged": return False if trigger.get("is_question"): - return True + if trigger.get("is_directed"): + return True + if acceptance_state == "warm" and flow_state == "deep_engaged" and trigger.get("priority", 0) >= 0.95: + return True + return False if trigger.get("is_followup"): return False if trigger.get("is_social_call"): diff --git a/plugins/ai_auto_response/triggers.py b/plugins/ai_auto_response/triggers.py index 1660a23..1f9b356 100644 --- a/plugins/ai_auto_response/triggers.py +++ b/plugins/ai_auto_response/triggers.py @@ -21,6 +21,7 @@ class TriggerResult: trigger_type: str = "none" priority: float = 0.0 is_question: bool = False + is_directed: bool = False is_followup: bool = False is_social_call: bool = False is_returning_member: bool = False @@ -42,13 +43,13 @@ class TriggerRouter: result.trigger_type = "at_trigger" result.priority = float(self.config.get("at_bot", 1.0)) result.should_respond = True + result.is_directed = True result.reasons.append("is_at") if self._is_question(content): if result.priority < float(self.config.get("explicit_question", 0.95)): result.trigger_type = "question_trigger" result.priority = float(self.config.get("explicit_question", 0.95)) result.is_question = True - result.should_respond = True result.reasons.append("question") if memory_hints.get("is_followup"): if result.priority < float(self.config.get("followup", 0.90)): @@ -56,6 +57,7 @@ class TriggerRouter: result.priority = float(self.config.get("followup", 0.90)) result.is_followup = True result.should_respond = True + result.is_directed = True result.reasons.append("followup") topic = self._detect_topic(content_lower) if topic: @@ -69,6 +71,8 @@ class TriggerRouter: result.trigger_type = result.trigger_type if result.trigger_type != "none" else "social_trigger" result.priority = max(result.priority, float(self.config.get("social_call", 0.65))) result.is_social_call = True + result.is_directed = True + result.should_respond = True result.reasons.append("social_call") elif self._is_light_social_moment(content_lower): if result.priority < float(self.config.get("light_social", 0.45)): @@ -76,6 +80,8 @@ class TriggerRouter: result.priority = max(result.priority, float(self.config.get("light_social", 0.45))) result.is_social_call = True result.reasons.append("light_social") + if result.is_question and result.is_directed: + result.should_respond = True if memory_hints.get("returning_member_state") in {"returning_member", "long_absent_member"}: result.is_returning_member = True result.reasons.append(memory_hints.get("returning_member_state"))