Merge pull request #17190 from NousResearch/bb/tui-cold-start-profiling

perf(tui): cut visible cold start ~57% with lazy agent init
This commit is contained in:
brooklyn!
2026-04-28 22:45:14 -07:00
committed by GitHub
10 changed files with 309 additions and 161 deletions

View File

@@ -770,11 +770,19 @@ class TestLoadConfig(unittest.TestCase):
def test_returns_code_execution_section(self):
from tools.code_execution_tool import _load_config
mock_cli = MagicMock()
mock_cli.CLI_CONFIG = {"code_execution": {"timeout": 120, "max_tool_calls": 10}}
with patch.dict("sys.modules", {"cli": mock_cli}):
with patch("hermes_cli.config.read_raw_config",
return_value={"code_execution": {"timeout": 120, "max_tool_calls": 10}}):
result = _load_config()
self.assertIsInstance(result, dict)
self.assertEqual(result, {"timeout": 120, "max_tool_calls": 10})
def test_does_not_import_interactive_cli(self):
from tools.code_execution_tool import _load_config
mock_cli = MagicMock()
mock_cli.CLI_CONFIG = {"code_execution": {"timeout": 999}}
with patch.dict("sys.modules", {"cli": mock_cli}), \
patch("hermes_cli.config.read_raw_config", return_value={}):
result = _load_config()
self.assertEqual(result, {})
# ---------------------------------------------------------------------------