From c40531f071cf60c2d152fec71ab3fcb898e38cc2 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Tue, 27 Oct 2026 06:04:19 +0100 Subject: [PATCH] e2e: long_session cuts the last file of a turn to the budget (a whole file overshot the 256k context) Co-Authored-By: Claude Sonnet 5.5 --- scripts/e2e/long_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/e2e/long_session.py b/scripts/e2e/long_session.py index 90a7a184..c47debf2 100644 --- a/scripts/e2e/long_session.py +++ b/scripts/e2e/long_session.py @@ -45,7 +45,7 @@ def take(files, start, chars): parts, used, i = [], 0, start while i < len(files) and used < chars: with open(files[i], encoding="utf-8", errors="replace") as f: - text = f.read() + text = f.read()[: chars - used] # the last file is cut to the budget, so a turn never overshoots by a whole file parts.append("// ==== " + os.path.relpath(files[i], os.path.dirname(files[0])).replace("\\", "/") + "\n" + text) used += len(text) i += 1