mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
Merge remote-tracking branch 'origin/main' into wake-toggle-config
# Conflicts: # tests/test_tui_gateway_server.py # tui_gateway/server.py
This commit is contained in:
commit
0cf58de85e
251 changed files with 27112 additions and 3467 deletions
|
|
@ -10,8 +10,12 @@ def test_session_hooks_in_valid_hooks():
|
|||
assert "on_session_reset" in VALID_HOOKS
|
||||
|
||||
|
||||
@patch("hermes_cli.plugins.invoke_hook")
|
||||
def test_session_finalize_on_reset(mock_invoke_hook):
|
||||
# These tests pin CLI ownership of the finalize request. The end-to-end
|
||||
# built-in/core/plugin dispatch order is exercised by
|
||||
# tests/hermes_cli/test_lifecycle.py::test_finalize_session_closes_core_before_plugin_export.
|
||||
@patch("hermes_cli.lifecycle.invoke_hook")
|
||||
@patch("hermes_cli.lifecycle.finalize_session")
|
||||
def test_session_finalize_on_reset(mock_finalize_session, mock_invoke_hook):
|
||||
"""Verify on_session_finalize fires when /new or /reset is used."""
|
||||
cli = HermesCLI()
|
||||
cli.agent = MagicMock()
|
||||
|
|
@ -22,10 +26,10 @@ def test_session_finalize_on_reset(mock_invoke_hook):
|
|||
|
||||
# Check if on_session_finalize was called for the old session
|
||||
assert any(
|
||||
c.args == ("on_session_finalize",)
|
||||
not c.args
|
||||
and c.kwargs["session_id"] == "test-session-id"
|
||||
and c.kwargs["platform"] == "cli"
|
||||
for c in mock_invoke_hook.call_args_list
|
||||
for c in mock_finalize_session.call_args_list
|
||||
)
|
||||
# Check if on_session_reset was called for the new session
|
||||
assert any(
|
||||
|
|
@ -36,8 +40,8 @@ def test_session_finalize_on_reset(mock_invoke_hook):
|
|||
)
|
||||
|
||||
|
||||
@patch("hermes_cli.plugins.invoke_hook")
|
||||
def test_session_finalize_on_cleanup(mock_invoke_hook):
|
||||
@patch("hermes_cli.lifecycle.finalize_session")
|
||||
def test_session_finalize_on_cleanup(mock_finalize_session):
|
||||
"""Verify on_session_finalize fires during CLI exit cleanup."""
|
||||
import cli as cli_mod
|
||||
|
||||
|
|
@ -49,15 +53,15 @@ def test_session_finalize_on_cleanup(mock_invoke_hook):
|
|||
cli_mod._run_cleanup()
|
||||
|
||||
assert any(
|
||||
c.args == ("on_session_finalize",)
|
||||
not c.args
|
||||
and c.kwargs["session_id"] == "cleanup-session-id"
|
||||
and c.kwargs["platform"] == "cli"
|
||||
and c.kwargs["reason"] == "shutdown"
|
||||
for c in mock_invoke_hook.call_args_list
|
||||
for c in mock_finalize_session.call_args_list
|
||||
)
|
||||
|
||||
|
||||
@patch("hermes_cli.plugins.invoke_hook")
|
||||
@patch("hermes_cli.lifecycle.invoke_hook")
|
||||
def test_interrupted_session_end_helper_emits_observer_shape(mock_invoke_hook):
|
||||
"""Verify quiet single-query interruption emits a correlated session end."""
|
||||
import cli as cli_mod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue