mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
tests: pin ink engine in _make_tui_argv npm-bootstrap tests (post-merge semantic fix)
Main's rewritten test_tui_npm_install.py tests call _make_tui_argv expecting the Ink/npm flow unconditionally; with the dual-engine dispatch merged in, _resolve_tui_engine() auto-selects opentui whenever ui-opentui/dist is built in the repo, routing the call away from the path under test (first subprocess became 'node --version' instead of 'npm run build'). Pin the engine to ink via an autouse fixture, mirroring the existing pinning precedent in test_tui_resume_flow.py.
This commit is contained in:
parent
ab37440ce6
commit
e1067dbbe5
756 changed files with 79874 additions and 19585 deletions
|
|
@ -87,6 +87,27 @@ class TestQuietModeCacheIsolation:
|
|||
f"baseline={baseline}, final={len(final)}."
|
||||
)
|
||||
|
||||
def test_cache_bounded_by_eviction(self):
|
||||
"""The cache evicts the oldest entry when it reaches the cap,
|
||||
keeping the cache bounded instead of growing unbounded over a
|
||||
long-lived Gateway's lifetime (#19251)."""
|
||||
cap = model_tools._TOOL_DEFS_CACHE_MAX
|
||||
# Fill cache to the cap with distinct keys by varying enabled_toolsets.
|
||||
for i in range(cap):
|
||||
model_tools.get_tool_definitions(
|
||||
enabled_toolsets=[f"fake_toolset_{i}"], quiet_mode=True,
|
||||
)
|
||||
assert len(model_tools._tool_defs_cache) == cap
|
||||
|
||||
# Adding one more must evict the oldest, not clear everything and
|
||||
# not grow past the cap.
|
||||
model_tools.get_tool_definitions(
|
||||
enabled_toolsets=["fake_toolset_overflow"], quiet_mode=True,
|
||||
)
|
||||
assert len(model_tools._tool_defs_cache) == cap, (
|
||||
"Eviction should keep the cache at the cap, not clear it or grow"
|
||||
)
|
||||
|
||||
def test_non_quiet_mode_does_not_use_cache(self):
|
||||
"""Sanity: quiet_mode=False (TUI path) skips the cache entirely \u2014
|
||||
explains why the bug only hit Gateway."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue