fix(agent): add debug diagnostics for empty model responses

This commit is contained in:
konsisumer 2026-04-25 00:42:53 +02:00
parent 00c3d848d8
commit 38dab6dff4
9 changed files with 53 additions and 13 deletions

View file

@ -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