test: alternate roles in the #35809 bloat fixture

load_transcript is now a live-replay restore site that heals alternation
violations on load (#64934), so the old all-user 120-row fixture was
merged into a single message and the precondition len==120 failed. The
fixture was never a valid conversation shape; alternate user/assistant
so it exercises the same bloat scenario without tripping the repair.
This commit is contained in:
Teknium 2026-07-16 01:48:27 -07:00
parent 4851f894be
commit 0fe18b8650

View file

@ -151,8 +151,17 @@ def _make_source():
def _bloat(n):
# Stand-in for the oversized, post-compression "child" transcript that
# could not be compressed any further (#35809).
return [{"role": "user", "content": "x" * 2000} for _ in range(n)]
# could not be compressed any further (#35809). Alternates roles so the
# fixture is a valid conversation: load_transcript is a live-replay
# restore site and heals alternation violations on load (#64934), so a
# degenerate all-user transcript would be merged into one message.
return [
{
"role": "user" if i % 2 == 0 else "assistant",
"content": "x" * 2000,
}
for i in range(n)
]
class TestAutoResetLoadsCleanContext: