Files
hermes-agent/tests/agent/test_summary_prefix_tool_use.py
teknium1 b2ecd3518f test: purge low-value tests, lane py04 (294 removed)
Change-detectors, tautologies, source-reading tests, redundant duplicates,
mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane
ledger (category + reason for every removal).
2026-09-23 03:15:26 -07:00

29 lines
1010 B
Python

"""Regression tests for the SUMMARY_PREFIX tool-use clause (#65848 class).
The REFERENCE ONLY framing must keep its anti-resumption protections while
explicitly NOT restricting tool use — the strong wording was observed bleeding
into general tool-use suppression (narration-only turns after compression).
"""
from agent.context_compressor import (
_HISTORICAL_SUMMARY_PREFIXES,
SUMMARY_PREFIX,
)
class TestSummaryPrefixToolUseClause:
def test_strip_recognizes_current_and_frozen_prefixes(self):
"""Re-compaction normalization must strip both the live prefix and the
newly frozen one (the incident generation)."""
from agent.context_compressor import ContextCompressor
for prefix in (SUMMARY_PREFIX, _HISTORICAL_SUMMARY_PREFIXES[0]):
text = f"{prefix}\nsummary body here"
stripped = ContextCompressor._strip_summary_prefix(text)
assert "summary body here" in stripped
assert "REFERENCE ONLY" not in stripped