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:
Teknium 2026-06-11 22:40:26 -07:00
parent 434c684bfa
commit c7bee8f961
2 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -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