P0 Nachbesserungen + V7-1: Butler antwortet im Zielraum
Auflage 1: Unit-Tests für ConversationHistory (34 Tests)
- test_conversation_history.py: add/get, Ring-Buffer, topic_hint,
cleanup_orphaned_rooms (sync+async), Thread-safety, Edge cases
Auflage 2: Schritt-4.5 Stick-Check im Router
- router.py Zeile ~556: _check_never_route_topic VOR is_100_percent_match
in Schritt 4.5 (Keyword-Match vor LLM) eingefügt
Auflage 3: Topic-Extraktion zentralisieren
- router.py: room_name_to_topic als Module-Level-Alias exportiert
- adapter.py: importiert room_name_to_topic, ersetzt 2× inline
.lstrip('#').lower().replace(' ', '-') durch zentralen Aufruf
V7-1: Butler antwortet im Zielraum + Breadcrumb
- adapter.py _process_incoming: move_request_sent=True → return (kein Agent-Dispatch)
- adapter.py Move-Request-Handler: bei ✅Ja → Breadcrumb im Ursprungsraum,
_CURRENT_ORIGIN_ROOM + _THEMATIC_TARGET_ROOM auf Zielraum gesetzt,
_dispatch_agent() im Zielraum-Kontext
- adapter.py _dispatch_agent(): extrahierte Dispatch-Methode für V7-1-Pfad
Syntax-Check: alle .py bestehen py_compile
Tests: 99/100 passed (1 pre-existing env-var failure)
This commit is contained in:
@@ -547,6 +547,15 @@ class BidirectionalRouter:
|
||||
notification = f"📋 Bearbeite ich in #{room_name} — [Link]"
|
||||
matched_keywords = self._extract_matched_keywords(text, matched_room)
|
||||
|
||||
# ── P0-B: never_route topic check ──────────────────
|
||||
if self._check_never_route_topic(origin_room_id, matched_room):
|
||||
return RoutingDecision(
|
||||
category="direct_question",
|
||||
target_room="",
|
||||
confidence=1.0,
|
||||
stay_in_room=True,
|
||||
)
|
||||
|
||||
# ── FIX C: 100% vs Kontext-Keywords unterscheiden ──
|
||||
is_100 = self._room_map.is_100_percent_match(text, matched_room)
|
||||
if is_100:
|
||||
@@ -995,4 +1004,10 @@ class BidirectionalRouter:
|
||||
|
||||
logger.info("Moving message from %s to %s", source_room[:8], target_room[:8])
|
||||
# Die tatsächliche Implementierung erfolgt im Adapter
|
||||
return True
|
||||
return True
|
||||
|
||||
|
||||
# ── Module-level alias für externe Nutzer (adapter.py) ──────────────
|
||||
# Zentralisierte Topic-Extraktion: adapter.py importiert diese Funktion
|
||||
# statt die Logik an mehreren Stellen zu duplizieren.
|
||||
room_name_to_topic = BidirectionalRouter._room_name_to_topic
|
||||
Reference in New Issue
Block a user