Teknium
0f4587e336
refactor(compression): every compaction gate asks real usage first; rough estimates only decide whether to wait
...
Two parallel "real usage" mechanisms fought each other: the usage anchor (real + delta) and the
compressor's rough/real projection (should_defer_preflight_to_real_usage with
last_rough_tokens_when_real_prompt_fit / _pending_request_rough_tokens / note_request_rough_estimate
baselines). The projection stored an anchored, real-scale figure as its "rough" baseline, so a
rewind that invalidated the anchor produced phantom growth and a spurious compaction (#103391 ).
Now there is one authority:
- Post-tool gate (turn_preflight.compress_after_tool_results): anchored figure first (the raw
last_prompt_tokens ignored the tool results just appended), then real, then rough.
- Gateway hygiene (run_turn._hmwa_hygiene_plan): real session count, else the anchor persisted on
the session row, else rough.
- Preflight / pre-API gates: an anchored figure is never deferred. A whole-context rough estimate
over threshold waits ONE request for the provider's real count instead of compressing on a guess
(first request, rewind/edit-resend, reloaded history without a persisted anchor).
- The wait is one request, never a disable: a provider that omits usage
(note_usage_less_response, #2153 class), a real reading already over threshold, a rough figure
past the whole window, and provider-proven overflow all compress immediately; the post-compaction
latch (#36718 / #104192 ) is unchanged.
- Projection baselines and their bookkeeping deleted (-101 LOC in context_compressor); the fixtures
that scripted whole-history estimates now state the fact they relied on (provider omits usage).
Fixes #103391 (closes #103397 by construction — the baseline it repaired no longer exists).
2026-09-06 13:21:17 -07:00
..
2026-09-03 13:12:23 -07:00
2026-09-06 13:21:17 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 14:00:59 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-08-16 10:51:11 -07:00
2026-08-07 18:07:19 +05:30
2026-09-03 14:00:59 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-08-14 21:41:26 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 14:37:14 -07:00
2026-08-02 23:48:42 +05:30
2026-09-02 19:12:32 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:27:01 -07:00
2026-09-02 13:28:41 +05:30
2026-09-03 14:21:52 -07:00
2026-08-29 22:29:28 +05:30
2026-08-02 21:17:49 +05:30
2026-08-04 11:25:18 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-24 15:30:30 +05:30
2026-07-29 13:10:23 -07:00
2026-09-03 13:29:35 -07:00
2026-07-29 13:10:23 -07:00
2026-09-02 18:17:52 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 10:22:47 +05:30
2026-07-29 13:10:23 -07:00
2026-09-06 13:21:17 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:46:50 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:12:23 -07:00
2026-08-26 07:16:04 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 11:28:21 +05:30
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 14:00:59 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 13:36:25 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-01 21:42:19 -07:00
2026-09-03 13:28:22 -07:00
2026-08-03 20:43:38 +05:30
2026-09-03 03:41:52 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 13:46:50 -07:00
2026-09-05 15:54:14 +05:30
2026-08-30 05:16:10 -07:00
2026-09-02 13:29:40 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-02 16:57:21 +05:30
2026-09-03 13:28:22 -07:00
2026-08-13 21:38:30 +02:00
2026-08-03 22:53:32 +05:30
2026-09-03 13:28:22 -07:00
2026-09-02 13:30:15 -07:00
2026-09-01 09:28:31 -07:00
2026-08-20 11:36:54 +05:30
2026-08-30 19:46:11 -07:00
2026-09-03 03:31:03 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-08-23 18:25:19 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:48:49 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-01 14:56:30 +05:30
2026-07-29 13:10:23 -07:00
2026-08-21 15:02:29 -07:00
2026-07-29 13:10:23 -07:00
2026-07-31 21:52:36 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-08-30 05:15:54 -07:00
2026-08-21 17:24:22 +05:30
2026-08-30 05:16:10 -07:00
2026-08-30 05:16:10 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:12:23 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-02 18:45:20 -07:00
2026-09-03 13:28:22 -07:00
2026-08-12 19:15:02 -07:00
2026-09-06 09:09:00 -07:00
2026-08-25 03:55:55 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-06 09:09:00 -07:00
2026-09-03 13:28:22 -07:00
2026-09-06 05:55:18 -07:00
2026-09-03 13:28:22 -07:00
2026-08-20 00:03:50 +05:30
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-08-25 12:12:08 +05:30
2026-09-04 08:15:22 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-06 09:09:00 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-08-02 16:16:36 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-06 03:53:38 +05:30
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-08-14 22:11:30 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-08-16 01:55:00 -07:00
2026-09-03 04:46:41 +05:30
2026-09-03 13:28:22 -07:00
2026-09-05 10:54:19 +05:30
2026-09-03 13:28:22 -07:00
2026-09-03 03:42:15 -07:00
2026-08-08 14:08:44 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 13:16:47 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:16:47 -07:00
2026-07-29 13:10:23 -07:00
2026-08-13 21:38:30 +02:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:46:50 -07:00
2026-08-14 21:20:03 -07:00
2026-09-03 15:50:55 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 14:37:14 -07:00
2026-09-03 13:28:22 -07:00
2026-09-03 13:46:50 -07:00
2026-09-01 03:19:59 +05:30
2026-09-03 16:35:01 -07:00
2026-09-03 13:28:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00