Teknium
1634397ddb
fix(compress): abort instead of dropping messages when summary LLM fails ( #28102 )
...
When auxiliary compression's summary generation returns None (aux model
errored, returned non-JSON, timed out, etc.) the compressor previously
still dropped every middle message between compress_start..compress_end
and replaced them with a static 'Summary generation was unavailable'
placeholder. The session kept going but the user silently lost N turns
of context for nothing.
New behavior: on summary failure, compress() aborts entirely — returns
the input messages unchanged and sets _last_compress_aborted=True. The
existing _summary_failure_cooldown_until gate (30-60s) keeps the aux
model from being burned on every turn. Auto-compress callers detect
the no-op (len(after) == len(before)) and stop looping. The chat is
'frozen' at its current size until the next /compress or /new.
Manual /compress (CLI + gateway) now passes force=True which clears
the cooldown so users can retry immediately after an auto-abort. If
the manual retry also fails, the user gets a visible warning telling
them nothing was dropped and how to retry.
- agent/context_compressor.py: compress() gains force= kwarg; failure
branch sets _last_compress_aborted and returns messages unchanged
instead of inserting placeholder.
- run_agent.py: _compress_context() detects abort, surfaces warning,
skips session-rotation entirely, returns messages unchanged.
- cli.py + gateway/run.py: manual /compress paths pass force=True.
- gateway/run.py: hygiene + /compress handlers detect _last_compress_aborted
and emit the new 'Compression aborted' warning (gateway.compress.aborted)
instead of the old 'N historical messages were removed' message.
- locales/*.yaml: new gateway.compress.aborted key in all 16 locales.
- tests: updated to assert the abort contract (messages preserved,
compression_count not incremented, abort flag set, no placeholder
leaked). New test_force_true_bypasses_failure_cooldown covers the
manual-retry path.
2026-05-18 10:19:40 -07:00
..
2026-04-30 01:19:34 -07:00
2026-05-17 02:29:41 -07:00
2026-04-30 20:30:31 -07:00
2026-05-07 05:16:38 -07:00
2026-04-30 04:32:33 -07:00
2026-05-16 02:25:41 -07:00
2026-05-08 14:55:40 -07:00
2026-05-09 11:54:04 -07:00
2026-05-17 02:29:41 -07:00
2026-04-21 00:50:58 -07:00
2026-04-20 04:16:13 -07:00
2026-04-12 18:03:16 -07:00
2026-05-16 23:02:02 -07:00
2026-05-16 23:11:43 -07:00
2026-04-30 19:46:27 -07:00
2026-04-24 05:35:43 -07:00
2026-04-14 16:56:49 -07:00
2026-05-17 12:44:48 -07:00
2026-05-07 05:16:38 -07:00
2026-05-09 13:38:25 -07:00
2026-05-16 23:11:43 -07:00
2026-04-26 18:21:29 -07:00
2026-04-30 04:29:15 -07:00
2026-04-19 01:48:42 -07:00
2026-04-26 12:29:02 -07:00
2026-05-03 03:54:03 -07:00
2026-04-24 03:10:52 -07:00
2026-04-23 19:38:33 -05:00
2026-05-18 10:19:40 -07:00
2026-04-24 02:55:43 -07:00
2026-04-24 02:55:43 -07:00
2026-05-17 02:29:41 -07:00
2026-05-02 02:08:06 -07:00
2026-05-14 15:50:57 -07:00
2026-04-22 11:59:39 -07:00
2026-05-01 14:01:26 -07:00
2026-05-09 11:04:46 -07:00
2026-05-13 17:32:22 -07:00
2026-04-24 03:04:42 -07:00
2026-04-17 04:08:42 -07:00
2026-04-17 04:59:03 -07:00
2026-04-17 05:48:26 -07:00
2026-04-19 18:12:55 -07:00
2026-05-14 07:26:43 -07:00
2026-05-03 03:44:55 -07:00
2026-05-06 18:12:35 -07:00
2026-05-16 20:26:18 -07:00
2026-05-14 15:50:57 -07:00
2026-04-24 03:33:29 -07:00
2026-04-19 11:08:10 -07:00
2026-05-05 04:58:23 -07:00
2026-05-07 05:51:56 -07:00
2026-05-10 22:41:26 -07:00
2026-05-07 05:51:56 -07:00
2026-05-03 03:44:55 -07:00
2026-05-17 02:29:41 -07:00
2026-05-05 10:13:55 -07:00
2026-05-10 22:22:25 -07:00
2026-05-10 18:09:31 -07:00
2026-05-14 14:51:07 -07:00
2026-05-09 13:35:50 -07:00
2026-04-30 23:05:48 -07:00
2026-05-18 02:14:43 -07:00
2026-04-28 06:57:23 -07:00
2026-05-09 02:32:55 -07:00
2026-05-13 17:32:22 -07:00
2026-04-30 20:30:31 -07:00
2026-04-17 19:04:11 -07:00
2026-04-17 19:04:11 -07:00
2026-05-07 05:09:39 -07:00
2026-05-06 10:52:51 -07:00
2026-04-30 20:29:19 -07:00
2026-05-03 17:00:09 -07:00
2026-04-27 07:41:42 -07:00
2026-05-07 06:31:08 -07:00
2026-05-07 17:33:09 -07:00
2026-05-11 07:06:27 -07:00
2026-05-17 12:44:48 -07:00
2026-05-03 08:47:49 -07:00
2026-04-17 01:05:09 -07:00
2026-04-22 16:23:21 -07:00
2026-04-15 17:54:16 -07:00
2026-04-21 01:33:10 -07:00
2026-05-09 02:56:29 -07:00
2026-05-10 14:27:59 -07:00
2026-04-27 19:09:32 -07:00
2026-05-10 06:40:46 -07:00
2026-04-27 21:22:44 -07:00
2026-04-27 21:22:44 -07:00
2026-04-16 20:43:41 -07:00
2026-05-17 00:28:24 -07:00
2026-04-17 01:05:09 -07:00
2026-04-26 18:20:17 -07:00
2026-05-16 12:55:23 -07:00
2026-04-26 18:51:51 -07:00
2026-04-26 18:31:24 -07:00
2026-05-08 10:29:58 -07:00
2026-04-30 20:26:35 -07:00
2026-05-01 13:33:06 -07:00
2026-05-07 07:18:21 -07:00
2026-04-30 05:00:25 -07:00
2026-04-18 19:32:26 -07:00
2026-04-19 03:03:57 -07:00
2026-05-07 05:20:10 -07:00
2026-05-17 02:29:41 -07:00
2026-05-02 02:23:37 -07:00
2026-05-15 14:32:14 -07:00
2026-05-13 22:20:30 -07:00
2026-04-29 21:56:51 -07:00
2026-05-07 05:04:37 -07:00
2026-04-24 03:02:03 -07:00
2026-04-24 14:31:04 -07:00
2026-05-17 02:29:41 -07:00
2026-04-26 11:55:09 -07:00
2026-04-30 20:40:46 -07:00
2026-04-29 21:07:47 -07:00
2026-05-02 02:00:11 -07:00
2026-05-09 14:47:33 -07:00
2026-04-21 13:33:02 -07:00
2026-05-17 02:31:18 -07:00
2026-05-07 05:16:38 -07:00
2026-04-17 21:17:33 -07:00
2026-05-17 02:29:41 -07:00
2026-04-29 04:57:22 -07:00
2026-05-07 05:04:37 -07:00
2026-04-26 05:47:37 -07:00
2026-05-06 10:52:51 -07:00
2026-05-15 14:32:14 -07:00
2026-05-15 14:32:14 -07:00
2026-04-26 07:15:23 -07:00
2026-05-07 05:49:16 -07:00
2026-04-28 06:50:04 -07:00
2026-05-08 18:50:25 -07:00
2026-04-30 04:28:08 -07:00
2026-05-17 02:29:41 -07:00
2026-05-09 14:18:20 +03:00
2026-04-16 02:26:14 -07:00
2026-05-18 10:19:40 -07:00
2026-04-25 18:47:53 -07:00
2026-04-26 18:49:48 -07:00
2026-05-17 02:29:41 -07:00
2026-04-26 19:01:50 -07:00
2026-04-30 20:37:27 -07:00
2026-05-15 01:25:42 -07:00
2026-04-23 05:15:52 -07:00
2026-04-17 15:18:23 -07:00
2026-04-20 03:10:19 -07:00
2026-05-14 15:50:57 -07:00
2026-04-12 13:05:56 -07:00
2026-04-21 00:54:46 -07:00
2026-04-26 12:51:53 -07:00
2026-05-10 09:01:51 -07:00
2026-04-27 06:41:16 -07:00
2026-04-29 04:38:17 -07:00
2026-04-30 04:28:08 -07:00
2026-05-16 11:53:57 -07:00
2026-05-15 01:41:30 -07:00
2026-04-26 12:35:16 -07:00
2026-04-26 18:25:41 -07:00
2026-05-07 06:54:29 -07:00
2026-05-13 18:58:14 -07:00
2026-05-10 12:33:54 -07:00
2026-05-10 12:33:54 -07:00
2026-05-04 05:25:09 -07:00
2026-04-30 20:41:18 -07:00
2026-05-12 16:33:09 -07:00
2026-04-18 04:17:18 -07:00
2026-05-10 20:02:50 -07:00
2026-04-26 17:26:37 -07:00
2026-05-10 15:20:40 -07:00
2026-05-10 22:02:56 -07:00
2026-04-11 14:43:53 -07:00
2026-04-14 17:08:35 -07:00
2026-05-08 11:18:14 -07:00
2026-05-17 12:44:48 -07:00
2026-05-14 07:47:52 -07:00
2026-05-12 16:33:33 -07:00
2026-04-11 13:59:52 -07:00
2026-05-07 04:51:46 -07:00
2026-05-14 07:47:52 -07:00
2026-05-09 11:54:04 -07:00
2026-04-20 00:10:22 -07:00
2026-05-14 07:47:52 -07:00
2026-05-02 01:55:04 -07:00
2026-05-05 04:42:59 -07:00
2026-04-13 10:50:24 -07:00
2026-05-12 17:02:29 -07:00
2026-05-05 04:58:23 -07:00
2026-05-09 11:10:36 -07:00
2026-05-10 22:22:25 -07:00
2026-05-17 12:44:48 -07:00
2026-05-09 11:04:46 -07:00
2026-04-21 06:23:09 -07:00
2026-04-19 00:09:38 -07:00
2026-05-04 03:14:50 -07:00
2026-05-17 02:29:41 -07:00
2026-05-12 13:59:22 -04:00
2026-04-29 21:07:55 -07:00
2026-05-02 02:00:09 -07:00
2026-04-22 16:23:21 -07:00
2026-04-30 20:19:23 -07:00
2026-05-16 23:11:43 -07:00
2026-04-21 01:56:35 -07:00
2026-05-12 13:59:22 -04:00
2026-04-27 12:37:33 -07:00
2026-05-17 12:44:48 -07:00
2026-04-19 22:36:00 -07:00
2026-04-12 18:05:41 -07:00
2026-05-07 07:38:43 -07:00
2026-05-07 07:38:43 -07:00
2026-04-19 22:45:08 -07:00
2026-04-11 15:22:49 -07:00
2026-05-07 05:09:39 -07:00
2026-05-07 06:08:06 -07:00
2026-05-15 14:32:14 -07:00
2026-05-13 23:11:20 -07:00
2026-05-14 09:59:03 -07:00
2026-04-14 01:43:45 -07:00
2026-04-13 16:32:04 -07:00