fix: stop local terminal warning without minisweagent
This commit is contained in:
parent
607689095e
commit
329f83ff2d
2 changed files with 17 additions and 1 deletions
15
tests/tools/test_terminal_requirements.py
Normal file
15
tests/tools/test_terminal_requirements.py
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from tools.terminal_tool import check_terminal_requirements
|
||||||
|
|
||||||
|
|
||||||
|
def test_local_terminal_requirements_do_not_depend_on_minisweagent(monkeypatch, caplog):
|
||||||
|
"""Local backend uses Hermes' own LocalEnvironment wrapper and should not
|
||||||
|
be marked unavailable just because `minisweagent` isn't importable."""
|
||||||
|
monkeypatch.setenv("TERMINAL_ENV", "local")
|
||||||
|
|
||||||
|
with caplog.at_level(logging.ERROR):
|
||||||
|
ok = check_terminal_requirements()
|
||||||
|
|
||||||
|
assert ok is True
|
||||||
|
assert "Terminal requirements check failed" not in caplog.text
|
||||||
|
|
@ -1130,7 +1130,8 @@ def check_terminal_requirements() -> bool:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if env_type == "local":
|
if env_type == "local":
|
||||||
from minisweagent.environments.local import LocalEnvironment
|
# Local execution uses Hermes' own LocalEnvironment wrapper and does
|
||||||
|
# not depend on minisweagent being importable.
|
||||||
return True
|
return True
|
||||||
elif env_type == "docker":
|
elif env_type == "docker":
|
||||||
from minisweagent.environments.docker import DockerEnvironment
|
from minisweagent.environments.docker import DockerEnvironment
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue