Bernd (Hermes)
d265624f1c
fix(critical): Timeout-Hierarchie umkehren — innere Timeouts 3s < äußere 4s + Semaphore-Timeout + Embedding-Deadline
...
ROOT-CAUSE: Die Timeout-Hierarchie war umgekehrt. Der äußere
wait_for(4s) in adapter.py konnte nie feuern, weil die inneren
wait_for(25s) in classifier.py die Coroutine blockierten.
AENDERUNGEN:
- classifier.py: _llm_raw, _llm_classify, verify_confidence: 25.0s → 3.0s
- classifier.py: OllamaEmbeddingClient.get_embedding: ThreadPoolExecutor
mit .result(timeout=3.0) statt nacktem urllib.urlopen
- router.py: _llm_semaphore.acquire() mit asyncio.wait_for(timeout=3.0)
an 3 Stellen (_llm_room_lookup, _detect_recursive,
_validate_sentence_marker_llm)
- config.py: LLM_CONFIG timeout 10.0 → 3.0
- config.py: OLLAMA_CONFIG timeout 10.0 → 3.0
TIMEOUT-HIERARCHIE (nach Fix):
adapter.py wait_for: 4.0s (äußerst)
router.py semaphore acquire: 3.0s
classifier.py LLM-Calls: 3.0s
classifier.py Embedding-Calls: 3.0s
config.py LLM_CONFIG timeout: 3.0s
config.py OLLAMA_CONFIG timeout: 3.0s
Der äußere 4s-Timeout gewinnt jetzt immer.
2026-07-27 17:17:16 +02:00
Bernd (Hermes)
6990419bd0
fix(critical): Event-Loop-Blockade — ThreadPool-Saturation + Pulse-Interval + Classifier-Timeout
...
Root-Cause (Rainer): Pulse-Thread + Adapter-Calls + DDP-Fallback-Lawine
sättigen den ThreadPool (asyncio.to_thread). Der Loop-Selector kann
Watchdog-Probes nicht ausführen → 3 Strikes → Kill.
Änderungen:
- adapter.py: classify_and_route in asyncio.wait_for(4s), Timeout → STAY
- adapter.py: ThreadPoolExecutor max_workers=32 in on_connected_cb
- presence_engine.py: pulse_interval 1.5→5.0, sync-default, 2-stufiger CB
- classifier.py: _llm_raw/_llm_classify/verify_confidence in wait_for(25s)
2026-07-27 16:01:55 +02:00
Bernd (Hermes)
2599a574e1
fix(classifier): wrap sync generate() in asyncio.to_thread() — remove broken await on non-coroutine
2026-06-19 19:53:59 +02:00
Bernd (Hermes)
0e13e4b30d
fix(archivar): ContextVar→global dict, asyncio.to_thread, EMBEDDING_BASE_URL, FAISS_AUTO_ROUTE=0.55
...
- adapter.py: ContextVars durch globales _room_context dict + threading.Lock ersetzt
(Agent-Task sieht jetzt Archivar-Zielraum — kein error-not-allowed mehr)
- adapter_integration.py: Stay-Feedback-Handler leert thematic_target
(verhindert dass nächster Send auf alten Archivar-Vorschlag fällt)
- classifier.py: _llm_raw() nutzt asyncio.to_thread() statt direktem await
(LLMClient.generate() ist synchron — vorher TypeError)
- config.py: ARCHIVAR_EMBEDDING_BASE_URL trennt Embeddings von Chat-URL
(OLLAMA_BASE_URL-Kollision behoben). FAISS_AUTO_ROUTE 0.70→0.55
(mehr Nachrichten durch Booster statt direktem FAISS-Routing)
2026-06-19 09:09:17 +02:00
Bernd (Hermes)
3fe2dd832e
fix(archivar): correct Coroutine-Bug root cause — _llm_raw_sync→async _llm_raw, direct await
...
OllamaLLMClient.generate() is async def — run_in_executor cannot
correctly execute async functions. The coroutine was never awaited.
Also fix Move-Request parser: native button '1️⃣ Rüber' was not
matched against '1️⃣ ' — fell through to 'stay' instead of 'move'.
- classifier.py: _llm_raw_sync → async _llm_raw, await generate()
- router.py: remove run_in_executor, direct await _llm_raw()
- adapter.py: normalize MOVE_REQ choice (extract leading digit/emoji)
2026-06-17 22:01:45 +02:00
Bernd (Hermes)
170f7e6096
feat(archivar): LLM-basierter Raum-Router ersetzt IntentClassifier — Embedding-Vorfilter + LLM_ROOM_PROMPT + Move-Request-Buttons
...
Korrigierter Archivar-Routing-Flow gemäß Architekturskizze:
1. Embedding-Vorfilter (nomic-embed-text): binär Smalltalk vs. potenzieller Auftrag
- Klarer Smalltalk → stay_in_room
- Unsicher → LLM-Raum-Router
2. LLM-Raum-Router (qwen2.5:7b): LLM_ROOM_PROMPT als zentraler Prompt
- Erhält Nachrichtentext + Raumliste mit IDs und ALLEN Keywords
- Liefert room_id direkt (keine Kategorien, kein Name-Matching)
3. Move-Request-Buttons (Butler-Prinzip): ✅ Ja/📍 Hier VOR Routing
- Kein automatisches Routing ohne User-Bestätigung
4. Betriebsstufen-Log: 'Archivar Stufe 1: Embedding-Vorfilter + LLM-Raum-Router aktiv (5 Räume)'
Änderungen:
- config.py: LLM_ROOM_PROMPT auf Raum-ID-Ausgabe umgestellt, Keywords pro Raum,
ARCHIVAR_STUFE_LOG, MOVE_REQUEST_TEMPLATE, max_tokens=30
- classifier.py: LLMClient.generate() als neue ABC-Methode + OllamaLLMClient-Impl,
_llm_raw_sync nutzt generate() statt classify()
- router.py: RoutingDecision um move_request_sent/target_name/target_id erweitert,
route() komplett neu: Embedding→LLM→Move-Request, _llm_room_lookup() mit IDs+Keywords
- adapter_integration.py: _send_move_request() + handle_move_request_response(),
classify_and_route() behandelt move_request_sent, handle_and_forward() wartet auf Bestätigung
IntentClassifier.classify() wird NICHT gelöscht — nur als binärer Vorfilter verwendet.
Bestehende Tests: 53/54 grün (1 pre-existing env-var issue).
2026-06-14 10:25:33 +02:00
Hermes Agent
5e8e9c9a9c
feat(archivar): Implement Intent-Erkenner und Confidence-Framework für Archivar v3
2026-06-11 21:40:21 +02:00
Hermes Agent
9bc06ef858
Task 1: LLM_CONFIDENCE_THRESHOLD-Zweig entfernt und durch einfaches Return des Embedding-Ergebnisses ersetzt
2026-06-06 06:14:45 +02:00
Hermes Agent
58f00c0c23
feat(archivar): Phase 1-3 — RoomMap + thematischer Router
...
Phase 1 (Datenmodell):
- plugin/archivar/room_map.py: RoomMap, RoomEntry, RoomMapValidationError
- room-map.schema.json: JSON-Schema für room-map.json
- room-map.json: Echte Raum-IDs (RC, BAT, LAN-Doku, DM Andreas)
- config.py: LLM_ROOM_PROMPT, ROOM_MAP_PATH, deprecated-Marker
Phase 2 (Router-Umbau):
- router.py: MessageRouter nutzt RoomMap statt ROOM_MAPPING Env-Vars
- Neue Methode _llm_room_lookup() fragt LLM: 'In welchen Raum?'
- Keyword-Match aus RoomEntry.keywords (vor Embedding)
- Excluded rooms check via RoomMap.is_excluded()
- origin_room_id Parameter für Multi-Agent-Raum-Ausschluss
Phase 3 (Integration):
- adapter_integration.py: _load_room_map() mit Env-Var-Fallback
- validate() beim Gateway-Start
- classify_and_route() reicht origin_room_id durch
- classifier.py: _llm_raw_sync() für Room-Prompts (nicht Kategorien)
12/12 Unit-Tests bestanden ✅
2026-06-05 22:06:32 +02:00
Hermes Agent
e5a32abf5c
feat(archivar): dreistufiger Klassifikator — Keyword + Embedding + LLM (qwen2.5:7b)
...
Phase 3 (Miguel): 236 Zeilen in config.py, classifier.py, adapter_integration.py.
Phase 4 (Rainer): Quality Gate F1–F5 bestanden.
- Stufe 0: Keyword-Vorfilter mit erweiterten ALARM/FRAGE-Listen
- Stufe 1: Embedding (nomic-embed-text, Schwelle 0.70)
- Stufe 2: LLM-Klassifikation (qwen2.5:7b) für Grenzfälle
- Feature-Flag ARCHIVAR_ENABLE_LLM über Env-Variable
- LLMClient-Interface für Testbarkeit
- router.py unverändert (Blackbox-Integration)
2026-06-04 21:49:17 +02:00
Hermes Agent
bb8623aed5
fix: binary corruption in adapter.py + absolute→relative imports in archivar/
...
- adapter.py: recopied from production (write_file corrupted the em-dash on line 8)
- All archivar/*.py: from archivar.X → from .X for plugin-context compatibility
2026-06-03 10:17:03 +02:00
Hermes Agent
88b7149dd1
feat: Archivar delivery + install.sh v2.2 — full function set
...
- Add archivar/ submodule to plugin/ (5 files, relative imports)
- Update adapter.py with relative Archivar import from .archivar.adapter_integration
- install.sh: fix --non-interactive env-var reading (Z.316-318, Bug #7 )
- install.sh: recursive file copy (was 4 flat files, now entire plugin/ tree incl. submodules)
- install.sh: Ollama presence check + nomic-embed-text pull
- install.sh: write OLLAMA_BASE_URL to rocketchat.env
- install.sh: add new message keys (collama_check, nomic_pull, nomic_ok, nomic_fail, copied)
Closes: Archivar delivery gap (2026-06-03)
Reviewed-by: Bernd (Advisor)
2026-06-03 10:12:47 +02:00