test: adapt summary-continuity + rotation-flush fixtures to the lean default
Continuity tests pin tail_mode=legacy (they assert the raw LLM text terminates the stored summary; lean's verbatim-user appendix follows it by design and the contract under test is mode-independent). The #57491 rotation fixture grows 200→2000 chars/message: at ~2.5K total tokens the old fixture fit entirely inside lean's 10K tail floor, so the no-growth guard correctly refused the rotation the test exercises.
This commit is contained in:
@@ -21,6 +21,11 @@ def _compressor(protect_first_n: int = 1) -> ContextCompressor:
|
||||
protect_first_n=protect_first_n,
|
||||
protect_last_n=1,
|
||||
quiet_mode=True,
|
||||
# Pinned: these tests assert the stored summary ENDS with the raw
|
||||
# LLM text. Lean mode (the default since the tail-default flip)
|
||||
# appends the verbatim-user-quote appendix after it by design;
|
||||
# the continuity contract under test is mode-independent.
|
||||
tail_mode="legacy",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -299,11 +299,14 @@ class TestFlushAfterCompression:
|
||||
# The transcript must also be large enough that the provider-less
|
||||
# static fallback net-shrinks it (middle drops must outweigh the
|
||||
# fixed compaction marker overhead), or the no-growth commit guard
|
||||
# correctly refuses the rotation this test exercises.
|
||||
# correctly refuses the rotation this test exercises. Sized for
|
||||
# the lean tail default: the 10K-token tail floor must leave a
|
||||
# substantial compressible middle (~2K chars/message × 40 ≈ 20K
|
||||
# estimated tokens total).
|
||||
messages = [
|
||||
{
|
||||
"role": "user" if i % 2 == 0 else "assistant",
|
||||
"content": f"message {i} " + "x" * 200,
|
||||
"content": f"message {i} " + "x" * 2000,
|
||||
"_db_persisted": True,
|
||||
}
|
||||
for i in range(40)
|
||||
|
||||
Reference in New Issue
Block a user