kshitij
469296c748
refactor(compression): tighten the oversized-turn exception after review
...
Review findings folded into the exception added by the previous commit:
- The anchored-region check now reuses `_walk_tail_budget` instead of a
second token sum with the default thought-charge rule. The walk charges
thinking only on the newest assistant turn unless the route replays stale
thinking (#73624/#84371), so the second rule could fire the exception on a
region the walk itself considers inside the ceiling.
- Two conjuncts (`last_user_idx >= head_end`, `last_user_idx < cut_idx`) are
implied by `user_anchored_cut < cut_idx`, which only changes when the
anchor found a real user turn inside the compressible region; the check
that depended on them is documented where it is read.
- The latest-assistant anchor is no longer computed and discarded under the
exception (it also logged an anchor it never applied).
- `_find_last_user_message_idx` early-exits instead of materialising every
actionable user index on the per-attempt boundary path.
- The exception logs at debug, like the sibling anchor decisions, rather
than at info from both `_compress_window` and `has_content_to_compress`.
Adds the missing guard test for the new ceiling check: a transcript that
fits the tail budget must still anchor the active request rather than
triggering the exception. Red when the ceiling conjunct is removed.
2026-09-19 21:12:46 +05:30
..
2026-09-19 01:55:38 -07:00
2026-09-13 05:07:50 -07:00
2026-09-18 10:22:14 -07:00
2026-09-13 05:07:11 -07:00
2026-09-19 16:20:29 +05:30
2026-09-18 09:54:13 -07:00
2026-09-15 04:56:01 -07:00
2026-09-06 20:50:02 +05:30
2026-09-16 11:06:06 -07:00
2026-09-13 09:18:02 -07:00
2026-09-19 16:28:57 +05:30
2026-09-19 12:12:04 +05:30
2026-09-17 08:59:50 -07:00
2026-09-19 01:44:10 +05:30
2026-09-19 11:25:23 +05:30
2026-09-06 05:37:03 -07:00
2026-09-17 08:46:05 -07:00
2026-09-14 20:01:19 +05:30
2026-09-03 17:13:22 -07:00
2026-09-17 08:53:15 -07:00
2026-09-19 02:37:36 -07:00
2026-09-17 08:45:46 -07:00
2026-09-17 09:07:51 -07:00
2026-09-19 02:37:36 -07:00
2026-09-17 09:11:38 -07:00
2026-09-18 11:11:44 -07:00
2026-09-07 06:02:22 -07:00
2026-09-13 05:19:48 -07:00
2026-09-07 07:06:58 -07:00
2026-09-19 16:21:40 +05:30
2026-09-18 15:15:02 -07:00
2026-09-16 11:06:06 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-15 03:39:07 -07:00
2026-09-19 02:37:36 -07:00
2026-09-18 01:43:35 +05:30
2026-09-07 05:24:15 -07:00
2026-09-18 10:10:40 -07:00
2026-09-16 14:23:20 -07:00
2026-09-18 09:34:10 -07:00
2026-09-06 22:45:31 +05:30
2026-09-15 03:47:15 -07:00
2026-09-03 09:44:26 -07:00
2026-09-18 10:36:11 -07:00
2026-09-13 05:09:43 -07:00
2026-09-18 10:36:11 -07:00
2026-09-19 21:12:46 +05:30
2026-09-11 02:07:48 -07:00
2026-09-16 17:17:47 -07:00
2026-09-16 16:59:03 -07:00
2026-09-13 05:20:26 -07:00
2026-09-18 13:58:52 -07:00
2026-09-19 12:12:04 +05:30
2026-09-18 09:33:38 -07:00
2026-09-16 17:16:06 -07:00
2026-09-16 17:16:06 -07:00
2026-09-19 11:25:23 +05:30
2026-09-18 20:55:24 -07:00
2026-09-11 03:45:33 +05:30
2026-09-19 03:15:10 -07:00
2026-09-19 03:15:10 -07:00
2026-09-07 08:19:32 -07:00
2026-09-16 17:48:48 -07:00
2026-09-18 10:03:04 -07:00
2026-09-03 04:31:46 -07:00
2026-09-19 02:37:36 -07:00
2026-09-17 12:28:25 +05:30
2026-09-03 17:13:22 -07:00
2026-09-18 01:43:35 +05:30
2026-09-18 10:08:58 -07:00
2026-09-18 09:28:39 -07:00
2026-09-14 06:44:54 -07:00
2026-09-11 15:26:46 -07:00
2026-09-17 13:52:36 +05:30
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-16 17:09:50 -07:00
2026-09-12 01:35:05 -07:00
2026-09-15 03:58:05 -07:00
2026-09-12 08:23:13 -07:00
2026-09-18 13:01:12 -04:00
2026-09-16 17:48:17 -07:00
2026-09-07 08:28:43 -07:00
2026-09-18 09:21:42 -07:00
2026-09-11 11:54:49 -07:00
2026-09-03 22:00:01 -07:00
2026-09-15 19:03:33 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 22:21:06 -07:00
2026-09-13 05:19:48 -07:00
2026-09-15 03:47:15 -07:00
2026-09-14 20:35:28 +05:30
2026-09-19 21:12:46 +05:30
2026-09-18 20:56:35 -07:00
2026-09-18 20:56:35 -07:00
2026-09-17 18:36:10 -07:00
2026-09-18 15:40:37 +05:30
2026-09-13 05:09:43 -07:00
2026-09-18 01:43:35 +05:30
2026-09-17 12:28:25 +05:30
2026-09-06 09:11:04 -07:00
2026-09-13 05:09:06 -07:00
2026-09-18 15:40:37 +05:30
2026-09-11 15:26:46 -07:00
2026-09-16 11:06:06 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-17 09:03:29 -07:00
2026-09-18 09:56:28 -07:00
2026-09-16 17:17:47 -07:00
2026-09-03 17:13:22 -07:00
2026-09-14 06:55:54 -07:00
2026-09-03 09:44:26 -07:00
2026-09-18 10:22:14 -07:00
2026-09-15 06:16:38 -07:00
2026-09-11 03:45:33 +05:30
2026-09-18 15:40:37 +05:30
2026-09-14 20:35:28 +05:30
2026-09-13 21:27:35 -07:00
2026-09-10 09:22:31 -07:00
2026-09-18 09:58:12 -07:00
2026-09-18 09:52:36 -07:00
2026-09-15 03:44:36 -07:00
2026-09-03 17:13:22 -07:00
2026-09-16 17:10:13 -07:00
2026-09-13 19:23:09 +05:30
2026-09-13 05:09:43 -07:00
2026-09-08 04:38:47 -07:00
2026-09-03 17:13:22 -07:00
2026-09-18 10:22:47 -07:00
2026-09-15 19:23:53 -07:00
2026-09-17 20:56:27 +05:30
2026-09-06 05:35:12 -07:00
2026-09-18 01:43:35 +05:30
2026-09-13 05:07:11 -07:00
2026-09-03 17:13:22 -07:00
2026-09-18 12:51:22 -07:00
2026-09-07 07:10:28 -07:00
2026-09-18 10:22:47 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 03:31:03 -07:00
2026-09-18 01:43:35 +05:30
2026-09-03 12:29:52 -07:00
2026-09-18 01:43:35 +05:30
2026-09-03 03:31:03 -07:00
2026-09-15 18:19:26 -07:00
2026-09-09 10:31:26 +05:30
2026-09-18 01:43:35 +05:30
2026-09-16 06:27:23 -05:00
2026-09-03 13:24:04 -07:00
2026-09-04 00:15:16 -07:00
2026-09-13 05:20:26 -07:00
2026-09-15 04:12:13 -07:00
2026-09-18 10:56:00 -07:00
2026-09-10 02:21:16 +05:30
2026-09-18 10:38:08 -07:00
2026-09-18 10:03:04 -07:00
2026-09-18 10:03:04 -07:00
2026-09-06 22:56:51 +05:30
2026-09-12 08:25:14 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 00:15:16 -07:00
2026-09-18 01:43:35 +05:30
2026-09-18 10:21:05 -07:00
2026-09-14 20:35:28 +05:30
2026-09-10 10:45:57 -07:00
2026-09-06 13:21:17 -07:00
2026-09-18 10:56:00 -07:00
2026-09-18 01:43:35 +05:30
2026-09-18 10:38:08 -07:00
2026-09-16 17:48:17 -07:00
2026-09-15 04:18:34 -07:00
2026-09-18 20:56:35 -07:00
2026-09-19 12:12:04 +05:30
2026-09-18 01:43:35 +05:30
2026-09-18 09:21:42 -07:00
2026-09-09 12:17:57 +05:30
2026-09-18 01:43:35 +05:30
2026-09-18 19:18:57 -07:00
2026-09-18 01:43:35 +05:30
2026-09-18 09:49:14 -07:00
2026-09-19 02:37:36 -07:00
2026-09-07 06:15:43 -07:00
2026-09-18 01:43:35 +05:30
2026-09-18 01:43:35 +05:30
2026-09-15 20:44:42 +05:30
2026-09-18 09:21:42 -07:00
2026-09-18 01:43:35 +05:30
2026-09-18 01:43:35 +05:30
2026-09-18 09:52:36 -07:00
2026-09-17 18:36:10 -07:00
2026-09-06 13:21:17 -07:00
2026-09-10 02:44:26 -07:00
2026-09-10 11:48:01 -07:00
2026-09-15 04:56:01 -07:00
2026-09-13 05:08:29 -07:00
2026-09-18 10:22:14 -07:00
2026-09-04 00:15:16 -07:00
2026-09-15 04:48:20 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 07:17:00 -07:00