mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-12 08:51:53 +00:00
refactor(agent): drop unused tail_start param from _derive_auto_focus_topic
The parameter was reserved-but-unused (del'd immediately); YAGNI. Test call site updated.
This commit is contained in:
parent
434c684bfa
commit
c7bee8f961
2 changed files with 2 additions and 4 deletions
|
|
@ -1630,11 +1630,9 @@ This compaction should PRIORITISE preserving all information related to the focu
|
|||
def _derive_auto_focus_topic(
|
||||
cls,
|
||||
messages: List[Dict[str, Any]],
|
||||
tail_start: int,
|
||||
) -> Optional[str]:
|
||||
"""Infer a compact focus hint from the most recent real user turns."""
|
||||
candidates: list[str] = []
|
||||
del tail_start # Reserved for callers that already know the protected-tail boundary.
|
||||
for idx in range(len(messages) - 1, -1, -1):
|
||||
msg = messages[idx]
|
||||
if msg.get("role") != "user":
|
||||
|
|
@ -2108,7 +2106,7 @@ This compaction should PRIORITISE preserving all information related to the focu
|
|||
)
|
||||
|
||||
# Phase 3: Generate structured summary
|
||||
summary_focus_topic = focus_topic or self._derive_auto_focus_topic(messages, compress_end)
|
||||
summary_focus_topic = focus_topic or self._derive_auto_focus_topic(messages)
|
||||
summary = self._generate_summary(turns_to_summarize, focus_topic=summary_focus_topic)
|
||||
|
||||
# If summary generation failed, behavior splits on
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ def test_auto_focus_skips_context_summary_handoff():
|
|||
{"role": "assistant", "content": "Latest tail response"},
|
||||
]
|
||||
|
||||
focus_topic = compressor._derive_auto_focus_topic(messages, tail_start=1)
|
||||
focus_topic = compressor._derive_auto_focus_topic(messages)
|
||||
|
||||
assert "OpenViking" in focus_topic
|
||||
assert "Bybit" not in focus_topic
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue