fix(archivar): P-108 Sticky-Scope bleibt im Ursprungsraum bei themenarmer Folge-Nachricht
This commit is contained in:
+22
-3
@@ -1377,6 +1377,10 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
# V8.3-4: Expliziter Raumwechsel-Sticky (30 Min TTL)
|
||||
# {origin_room: {target_room, target_name, sticky_topic, expires_at}}
|
||||
self._explicit_switch_sticky: Dict[str, Dict[str, Any]] = {}
|
||||
# P-108a: Flag — Sticky wurde in diesem Turn via B2 (kein 100%-Keyword-Match)
|
||||
# bypassed. Verhindert, dass der Archivar-Fallthrough (Setter B) den Sticky
|
||||
# ungeprüft erneuert. Wird pro Turn am Anfang des Archivar-Blocks zurückgesetzt.
|
||||
self._sticky_bypassed_this_turn: bool = False
|
||||
# V7-2: _sticky_rooms removed — thematic never_route replaces spatial bypass.
|
||||
# The router's _check_never_route_topic handles per-topic blocking now.
|
||||
# Clarify state: maps clarify_id → session_key for gateway resolution
|
||||
@@ -3927,6 +3931,10 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
# Intentional bypass paths setzen False. Fall-through paths
|
||||
# (Sticky-Bypass, B2-No-Topic, Expliziter-Wechsel-ohne-#) behalten True.
|
||||
_should_classify = True
|
||||
# P-108a: Sticky-Bypass-Flag pro Turn zurücksetzen. Der B2-Block
|
||||
# (kein 100%-Keyword-Match) setzt es, der Archivar-Fallthrough
|
||||
# (Setter B) prüft es, um den Sticky nicht ungeprüft zu erneuern.
|
||||
self._sticky_bypassed_this_turn = False
|
||||
|
||||
try:
|
||||
if _MULTIROOM() and self.archivar is not None:
|
||||
@@ -3999,10 +4007,18 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
logger.info(
|
||||
"[rocketchat] V8.3.4 B2: No topic extracted from message — "
|
||||
"sticky_topic='%s' but no 100%% keyword match → ignoring sticky, "
|
||||
"falling through to Archivar",
|
||||
"staying in origin room (P-108)",
|
||||
sticky_topic,
|
||||
)
|
||||
# Fall through to Archivar classification
|
||||
# P-108: Sticky ignorieren, Nachricht im Ursprungsraum behalten.
|
||||
# KEIN Fall-through zum Archivar — die Nachricht gehört
|
||||
# offensichtlich zum aktuellen Raum. _should_classify=False
|
||||
# verhindert, dass der Archivar erneut routet; die Nachricht
|
||||
# wird normal an den Agent dispatcht.
|
||||
# P-108a: Flag setzen, damit der Archivar-Fallthrough
|
||||
# (Setter B) den Sticky NICHT ungeprüft erneuert.
|
||||
self._sticky_bypassed_this_turn = True
|
||||
_should_classify = False
|
||||
else:
|
||||
# Thema matcht → Sticky greift
|
||||
# V8.1.1 R1: Catch-All-Guard — nicht in Catch-All-Raum auto-routen
|
||||
@@ -4406,7 +4422,10 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
# V8.3-5: Temporäres Sticky mit Topic-Scoping (30 Min TTL)
|
||||
# V8.3.2 F1: Nur setzen wenn decision.set_sticky=True
|
||||
# (100%-Keyword-Match). FAISS/LLM-Routing setzt KEINEN Sticky.
|
||||
if getattr(decision, 'set_sticky', False):
|
||||
# P-108a: Wenn der B2-Block oben den Sticky bypassed hat
|
||||
# (kein 100%-Keyword-Match), darf der Archivar-Fallthrough den
|
||||
# Sticky NICHT ungeprüft erneuern.
|
||||
if getattr(decision, 'set_sticky', False) and not self._sticky_bypassed_this_turn:
|
||||
self._session_room_preferences[room_id] = {
|
||||
"target_room": target_room_id,
|
||||
"target_name": target_name,
|
||||
|
||||
Reference in New Issue
Block a user