fix: rename plugin/tools.py to plugin/rc_tools.py to resolve shadowing of hermes-internal tools/ package
plugin/tools.py existed since v2.0 and shadowed the hermes-internal tools/ package via PYTHONPATH. This caused 'from tools.registry import tool_error' to fail in the gateway cleanup hook (gateway.cgroup_cleanup). Changes: - Rename plugin/tools.py -> plugin/rc_tools.py - Update import in plugin/__init__.py: from .tools -> from .rc_tools - Update comment in rc_tools.py referencing the old module name - Hermes-internal imports (tools.registry, tools.clarify_gateway) left untouched - All 117 tests pass (1 pre-existing failure in test_install_update_only.py unrelated)
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ def register(ctx):
|
|||||||
_MULTIROOM = os.getenv("MULTIROOM_AGENT", "true").strip().lower() not in ("false", "0", "no", "off")
|
_MULTIROOM = os.getenv("MULTIROOM_AGENT", "true").strip().lower() not in ("false", "0", "no", "off")
|
||||||
|
|
||||||
from .adapter import RocketChatAdapter # lazy import avoids circular deps
|
from .adapter import RocketChatAdapter # lazy import avoids circular deps
|
||||||
from .tools import register_tools
|
from .rc_tools import register_tools
|
||||||
|
|
||||||
ctx.register_platform(
|
ctx.register_platform(
|
||||||
name="rocketchat",
|
name="rocketchat",
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import urllib.parse
|
|||||||
|
|
||||||
|
|
||||||
# Inlined from tools.registry — avoids import conflict with the plugin's
|
# Inlined from tools.registry — avoids import conflict with the plugin's
|
||||||
# own tools.py module (which shadows the core tools/ package when the
|
# own rc_tools.py module (which used to shadow the core tools/ package when
|
||||||
# plugin directory is on sys.path).
|
# the plugin directory is on sys.path).
|
||||||
def tool_error(message, **extra) -> str:
|
def tool_error(message, **extra) -> str:
|
||||||
result = {"error": str(message)}
|
result = {"error": str(message)}
|
||||||
if extra:
|
if extra:
|
||||||
Reference in New Issue
Block a user