From 0fe18b86505e94dc8d32b69e0879483648bba9ad Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 16 Jul 2026 01:48:27 -0700 Subject: [PATCH] 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. --- .../gateway/test_35809_auto_reset_clean_context.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/gateway/test_35809_auto_reset_clean_context.py b/tests/gateway/test_35809_auto_reset_clean_context.py index 4bc2ef40dc57..0109a94bb863 100644 --- a/tests/gateway/test_35809_auto_reset_clean_context.py +++ b/tests/gateway/test_35809_auto_reset_clean_context.py @@ -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: