mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
fix(tests): catch up six stale tests after compression/aux/kanban changes (#28465)
- aux_config: drop session_search from _AUX_TASKS and remove stale test
(PR #27590 removed auxiliary.session_search from DEFAULT_CONFIG)
- compression_boundary_hook: set compressor._last_compress_aborted=False
on MagicMock so the post-compress abort branch (PR #28117) doesn't
short-circuit before the session-id rotation under test
- kanban_dashboard_plugin: use consecutive_failures=3 so severity stays
'error' (failure_threshold default dropped from 3 to 2 in d9fef0c8a,
so failures=5 now crosses the critical floor of 2*2=4)
- cli_manual_compress: accept force kwarg on DummyAgent._compress_context
(cli._manual_compress now passes force=True)
This commit is contained in:
parent
c4c45f11fa
commit
19128108ac
2 changed files with 8 additions and 1 deletions
|
|
@ -52,6 +52,11 @@ class TestCompressionBoundaryHook:
|
|||
compressor.last_completion_tokens = 0
|
||||
# Avoid the summary-error warning path
|
||||
compressor._last_summary_error = None
|
||||
# MagicMock auto-creates truthy attrs; explicitly clear the abort
|
||||
# flag so the post-compress abort branch in
|
||||
# conversation_compression.py does not short-circuit before the
|
||||
# session-id rotation we are asserting on.
|
||||
compressor._last_compress_aborted = False
|
||||
agent.context_compressor = compressor
|
||||
|
||||
original_sid = agent.session_id
|
||||
|
|
@ -137,6 +142,7 @@ class TestCompressionBoundaryHook:
|
|||
compressor.last_prompt_tokens = 0
|
||||
compressor.last_completion_tokens = 0
|
||||
compressor._last_summary_error = None
|
||||
compressor._last_compress_aborted = False
|
||||
|
||||
# Raise only on the compression-boundary call, not on earlier calls.
|
||||
def _raise_on_compression(*args, **kwargs):
|
||||
|
|
|
|||
|
|
@ -10,13 +10,14 @@ class DummyAgent:
|
|||
self.session_id = "new-session"
|
||||
self.calls = []
|
||||
|
||||
def _compress_context(self, messages, system_message, *, approx_tokens=None, focus_topic=None):
|
||||
def _compress_context(self, messages, system_message, *, approx_tokens=None, focus_topic=None, force=False):
|
||||
self.calls.append(
|
||||
{
|
||||
"messages": messages,
|
||||
"system_message": system_message,
|
||||
"approx_tokens": approx_tokens,
|
||||
"focus_topic": focus_topic,
|
||||
"force": force,
|
||||
}
|
||||
)
|
||||
return ([{"role": "user", "content": "[CONTEXT SUMMARY]: compacted"}], "new system prompt")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue