mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 01:51:44 +00:00
fix(agent): add debug diagnostics for empty model responses
This commit is contained in:
parent
00c3d848d8
commit
38dab6dff4
9 changed files with 53 additions and 13 deletions
|
|
@ -217,8 +217,14 @@ class FileToolsIntegrationTests(unittest.TestCase):
|
|||
def setUp(self) -> None:
|
||||
file_state.get_registry().clear()
|
||||
self._tmpdir = tempfile.mkdtemp(prefix="hermes_file_state_int_")
|
||||
self._orig_terminal_env = os.environ.get("TERMINAL_ENV")
|
||||
os.environ["TERMINAL_ENV"] = "local"
|
||||
|
||||
def tearDown(self) -> None:
|
||||
if self._orig_terminal_env is None:
|
||||
os.environ.pop("TERMINAL_ENV", None)
|
||||
else:
|
||||
os.environ["TERMINAL_ENV"] = self._orig_terminal_env
|
||||
import shutil
|
||||
shutil.rmtree(self._tmpdir, ignore_errors=True)
|
||||
file_state.get_registry().clear()
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import os
|
|||
import sys
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
from unittest.mock import patch
|
||||
|
||||
# Ensure repo root is importable
|
||||
_repo_root = Path(__file__).resolve().parent.parent.parent
|
||||
|
|
@ -33,6 +34,7 @@ except ImportError:
|
|||
class TestToolResolution:
|
||||
"""Verify get_tool_definitions returns all expected tools for eval."""
|
||||
|
||||
@patch.dict("os.environ", {"TERMINAL_ENV": "local"})
|
||||
def test_terminal_and_file_toolsets_resolve_all_tools(self):
|
||||
"""enabled_toolsets=['terminal', 'file'] should produce 6 tools."""
|
||||
from model_tools import get_tool_definitions
|
||||
|
|
@ -44,6 +46,7 @@ class TestToolResolution:
|
|||
expected = {"terminal", "process", "read_file", "write_file", "search_files", "patch"}
|
||||
assert expected == names, f"Expected {expected}, got {names}"
|
||||
|
||||
@patch.dict("os.environ", {"TERMINAL_ENV": "local"})
|
||||
def test_terminal_tool_present(self):
|
||||
"""The terminal tool must be present (not silently dropped)."""
|
||||
from model_tools import get_tool_definitions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue