Переглянути джерело

Import chattolib absolutely in hermes_check_fn

The relative .vendor.common.chattolib probe has no parent package when
adapter.py is loaded standalone (tests), so check_requirements() always
reported False; deployed as a package it would instead have loaded a
second chattolib copy — exactly what this file's import comment forbids.
Probe via the same absolute path every other chattolib use takes.
Paul Klumpp 1 тиждень тому
батько
коміт
b8f7a402c8
1 змінених файлів з 4 додано та 5 видалено
  1. 4 5
      adapter.py

+ 4 - 5
adapter.py

@@ -2207,14 +2207,12 @@ def hermes_validate_config(config: PlatformConfig) -> bool:
 
 
 def hermes_check_fn() -> bool:
-    """Check if Chatto is configured and dependencies are available.
-
-    Add real logic?! Or just .. there are no dependencies.. always return true. Really. Docs suck.
-    """
+    """Report whether the vendored chattolib dependency can be imported."""
     try:
-        from .vendor.common.chattolib import (
+        from chattolib import (
             client,  # noqa: F401 — vendored dependency probe
         )
+
         return True
     except ImportError:
         return False
@@ -2224,6 +2222,7 @@ def hermes_check_fn() -> bool:
 # is_connected probe
 # ---------------------------------------------------------------------------
 
+
 def hermes_is_connected(config: PlatformConfig) -> bool:
     """Check whether Chatto Plugin is connected. But where to: the Hermes Agent or the Chatto server.