mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-15 09:21:36 +00:00
perf(execute-code): stop waiting on idle RPC accept (#45948)
This commit is contained in:
parent
1b16c48170
commit
8f278403d1
2 changed files with 39 additions and 8 deletions
|
|
@ -17,6 +17,7 @@ import pytest
|
|||
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
|
||||
os.environ["TERMINAL_ENV"] = "local"
|
||||
|
||||
|
|
@ -199,6 +200,16 @@ class TestExecuteCode(unittest.TestCase):
|
|||
self.assertIn("hello world", result["output"])
|
||||
self.assertEqual(result["tool_calls_made"], 0)
|
||||
|
||||
def test_no_tool_call_script_does_not_wait_for_rpc_accept_timeout(self):
|
||||
"""A no-tool script should not wait seconds for the idle RPC accept thread."""
|
||||
start = time.monotonic()
|
||||
result = self._run('print("fast")')
|
||||
elapsed = time.monotonic() - start
|
||||
|
||||
self.assertEqual(result["status"], "success")
|
||||
self.assertIn("fast", result["output"])
|
||||
self.assertLess(elapsed, 2.0, f"execute_code took {elapsed:.3f}s")
|
||||
|
||||
def test_repo_root_modules_are_importable(self):
|
||||
"""Sandboxed scripts can import modules that live at the repo root."""
|
||||
result = self._run('import hermes_constants; print(hermes_constants.__file__)')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue