test: expect restored human anchor after user-role summary compaction

_is_real_user_message no longer accepts a user-role compaction summary as
the human anchor, so _compress_context restores the original user turn
after the summary; update the lifecycle-status test's expectation.
This commit is contained in:
kshitijk4poor 2026-07-19 08:51:13 +05:30 committed by kshitij
parent c03c247e7c
commit 9ef66ea8c1

View file

@ -583,7 +583,14 @@ class TestPreflightCompression:
approx_tokens=1234,
)
assert compressed == [{"role": "user", "content": f"{SUMMARY_PREFIX}\nPrevious conversation"}]
# The compressor returned only the user-role summary; a summary
# message no longer satisfies the human-anchor check, so the real
# user turn is restored after it (repair merges the pair
# summary-first before the next API call).
assert compressed == [
{"role": "user", "content": f"{SUMMARY_PREFIX}\nPrevious conversation"},
{"role": "user", "content": "hello"},
]
assert new_system_prompt == "new system prompt"
assert events[0][0] == "lifecycle"
assert "Compacting context" in events[0][1]