Skip to content

Hermes Agent context engine: the main model writes the compaction handoff on its cached prompt prefix

fix: keep warm failure notices accurate

Elevatormusice9f3a40025b9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 86f8bd2..44c6974 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@ All notable changes are listed here. The format follows [Keep a Changelog](https
### Added
- A WARNING for each compaction that does not use the warm path, with its reason (Hermes copies it to `errors.log`).
-- After 3 compactions in a row without the warm path, one notice with the reasons and the likely cause, in the logs and in the status of the next automatic compaction.
+- After 3 compactions in a row without the warm path, one notice with a hint for each distinct reason, in the logs and in the status of the next automatic compaction. Later failures update the pending notice and its fixed-summary count until Hermes shows it.
## [0.2.0] - 2026-10-06
diff --git a/README.md b/README.md
index 38195d3..502e8ea 100644
--- a/README.md
+++ b/README.md
@@ -169,16 +169,17 @@ The engine status (`get_status()`) has the same values in `warm_last`. The log n
### When the warm path keeps failing
-The plugin never stops a compaction: when the warm request cannot run, the fallback summary does the work. So that this does not go unseen:
+When the warm summary cannot be used, the plugin tries the fallback summary. If that summary cannot be used, it uses the fixed summary. The plugin reports these results:
- Each compaction without the warm path also writes a WARNING with its reason, for example `Warm compaction skipped (provider_error); used the fallback summary`. Hermes copies warnings to `logs/errors.log`.
-- After 3 compactions in a row without the warm path, the plugin writes one WARNING that names the reasons and the likely cause. Hermes shows a notice in its warning style with the status of the next automatic compaction, also when the compaction status is turned off. For example:
+- After 3 compactions in a row without the warm path, the plugin writes one WARNING with a hint for each distinct reason. Hermes shows one notice with the status of the next automatic compaction, also when the compaction status is turned off. Later failures update the pending notice until Hermes shows it. For example:
```text
- ⚠ Warm compaction unavailable: the last 3 compactions could not reuse the prompt cache (provider_error). Likely cause: the server refused the warm request (a provider error, or a gateway that needs a cookie). Compaction continues with the slower fallback summary — no messages were dropped. Details: the warm_compaction lines in logs/agent.log.
+ ⚠ Warm compaction unavailable: the last 3 compactions did not use the warm summary (provider_error: the server refused the warm request (a provider error, or a gateway that needs a cookie)). Compaction continues with the fallback summary. Details: the warm_compaction lines in logs/agent.log.
```
-- When the fallback summary also failed, the notice says how many times, and that those compactions used the fixed summary (no model, less detail).
+- When the fallback summary could not be used, the notice says how many times, and that those compactions used the fixed summary (no model, less detail).
+- A warm summary can fail the handoff checks even when the server reports cached tokens. The notice describes the summary result. It does not prove a cache miss, a speed change, or that all details were kept.
- A warm compaction or a session reset ends the streak, and the notice can show again after the next 3 failures. A cancelled attempt does not count, and `warm: false` is not a failure.
- Manual `/compress` has no status line from the engine: after manual compactions only, the notice is in the logs.
diff --git a/evidence/plugin-integration.json b/evidence/plugin-integration.json
index 00b5ffc..93a3e3c 100644
--- a/evidence/plugin-integration.json
+++ b/evidence/plugin-integration.json
@@ -1,16 +1,16 @@
{
"check": "standalone warm_compaction plugin on unpatched Hermes Agent",
- "started_utc": "2026-10-07T02:42:31Z",
+ "started_utc": "2026-10-07T03:03:46Z",
"hermes": {
"commit": "45871e100feceb89769536c88e5e6e265226a409",
"clean": true
},
"python": "3.11.14",
- "script_sha256": "6131d94a86e7fcbe74f3a3c3bbf19ec1bdc861a36a80d06a98f046e55b8047db",
+ "script_sha256": "33947de293d0167c457f2c8b967c57e4c5064a262357de4129376519b6e2f77d",
"plugin_files_sha256": {
"warm_compaction/__init__.py": "760484ace80b9da77d7397828f69178905c9ac95df7b8114956bde727bd98aef",
"warm_compaction/capture.py": "3158562b9b4d4ab50c0ec7a6524bbc1b1c364b137c6d8d27c5801220959021c8",
- "warm_compaction/engine.py": "2b4e788658531a77ef02684f7969645e03bc06856ffbcee036a6206ac6c52d21",
+ "warm_compaction/engine.py": "74eb8790e7e77f0213eb7bd28256cbd6d602d30f9edc02b5737391b825b1a9f0",
"warm_compaction/fallback.py": "dc2b7fbfdee292601e52549d23d9b7224d40da1d8c06f553f3d0b8e10a23534d",
"warm_compaction/handoff.py": "fcab51def8fbcc2b1928957930c9a5c58a4ad202c949fd9f870a77f3b30276ae",
"warm_compaction/layout.py": "b49314c5236268247c337d9fae939135c97b47384300dcdfd00b0da0c040db93",
@@ -76,19 +76,19 @@
"threshold_tokens": 100000,
"context_length": 200000
},
- "compress_seconds": 0.135,
+ "compress_seconds": 0.132,
"warm_last": {
"path": "warm",
"reason": "accepted",
- "elapsed_s": 0.036,
- "prompt_tokens": 33892,
- "cached_tokens": 16946
+ "elapsed_s": 0.038,
+ "prompt_tokens": 33855,
+ "cached_tokens": 16927
},
"session_rotated": false,
"final_session_id": "wc-enable_manual_warm",
"continuation_keeps_custom_system_text": false,
"fence_denied": {
- "child_process_blocked": 4,
+ "child_process_blocked": 5,
"network_host_blocked": 1
},
"fence_blocked_programs": [
@@ -189,7 +189,7 @@
"install",
"run"
],
- "process_seconds": 61.93
+ "process_seconds": 61.204
},
{
"scenario": "manual_fallback",
@@ -248,11 +248,11 @@
"threshold_tokens": 100000,
"context_length": 200000
},
- "compress_seconds": 0.273,
+ "compress_seconds": 0.296,
"warm_last": {
"path": "fallback",
"reason": "provider_error",
- "elapsed_s": 0.125,
+ "elapsed_s": 0.156,
"prompt_tokens": null,
"cached_tokens": null
},
@@ -260,7 +260,7 @@
"final_session_id": "wc-manual_fallback",
"continuation_keeps_custom_system_text": false,
"fence_denied": {
- "child_process_blocked": 4,
+ "child_process_blocked": 6,
"network_host_blocked": 1
},
"fence_blocked_programs": [
@@ -361,7 +361,7 @@
"install",
"run"
],
- "process_seconds": 35.685
+ "process_seconds": 47.329
},
{
"scenario": "manual_fixed",
@@ -419,11 +419,11 @@
"threshold_tokens": 100000,
"context_length": 200000
},
- "compress_seconds": 0.296,
+ "compress_seconds": 0.257,
"warm_last": {
"path": "fixed",
"reason": "provider_error",
- "elapsed_s": 0.156,
+ "elapsed_s": 0.11,
"prompt_tokens": null,
"cached_tokens": null
},
@@ -431,7 +431,7 @@
"final_session_id": "wc-manual_fixed",
"continuation_keeps_custom_system_text": false,
"fence_denied": {
- "child_process_blocked": 4,
+ "child_process_blocked": 5,
"network_host_blocked": 1
},
"fence_blocked_programs": [
@@ -532,7 +532,7 @@
"install",
"run"
],
- "process_seconds": 32.033
+ "process_seconds": 40.416
},
{
"scenario": "auto_tool_loop",
@@ -620,21 +620,21 @@
"warm_last_1": {
"path": "warm",
"reason": "accepted",
- "elapsed_s": 0.015,
- "prompt_tokens": 35209,
- "cached_tokens": 17604
+ "elapsed_s": 0.016,
+ "prompt_tokens": 34449,
+ "cached_tokens": 17224
},
"warm_last_2": {
"path": "warm",
"reason": "accepted",
- "elapsed_s": 0.0,
- "prompt_tokens": 19504,
- "cached_tokens": 9752
+ "elapsed_s": 0.016,
+ "prompt_tokens": 18744,
+ "cached_tokens": 9372
},
"compression_count": 2,
"fence_denied": {
- "network_host_blocked": 1,
- "child_process_blocked": 7
+ "child_process_blocked": 5,
+ "network_host_blocked": 1
},
"fence_blocked_programs": [
"git",
@@ -646,8 +646,7 @@
"hermes-assets.nousresearch.com"
],
"fence_blocked_callers": [
- "child_process_blocked from hermes_cli/local_runtime/processes.py:spawn_server < hermes_cli/_subprocess_compat.py:bounded_probe_run < hermes_cli/_subprocess_compat.py:bounded_git_probe",
- "child_process_blocked from hermes_cli/local_runtime/processes.py:spawn_server < hermes_cli/_subprocess_compat.py:bounded_probe_run < hermes_cli/_subprocess_compat.py:noninteractive_repo_git_env",
+ "child_process_blocked from hermes_cli/source_check.py:_git_run < hermes_cli/source_check.py:_git_stdout < hermes_cli/source_check.py:_read_checkout",
"child_process_blocked from tools/env_probe.py:_run < tools/env_probe.py:_py_out < tools/env_probe.py:_pip_python_version",
"child_process_blocked from tools/env_probe.py:_run < tools/env_probe.py:_py_out < tools/env_probe.py:_python_version_of",
"network_host_blocked from hermes_cli/release_channels.py:read < hermes_cli/release_channels.py:read_bytes < hermes_cli/release_channels.py:read_record"
@@ -736,7 +735,7 @@
"install",
"run"
],
- "process_seconds": 35.213
+ "process_seconds": 41.996
},
{
"scenario": "auto_warm_failures",
@@ -753,6 +752,8 @@
"one_notice": true,
"notice_before_the_fourth_compaction": true,
"notice_names_the_reason": true,
+ "notice_describes_the_summary_result": true,
+ "notice_has_no_cache_or_retained_detail_claim": true,
"each_refusal_in_agent_log": true,
"each_refusal_in_errors_log": true,
"notice_in_errors_log": true,
@@ -890,7 +891,7 @@
]
],
"notices": [
- "🗜️ Compacting context — summarizing earlier conversation so I can continue...\n⚠ Warm compaction unavailable: the last 3 compactions could not reuse the prompt cache (provider_error). Likely cause: the server refused the warm request (a provider error, or a gateway that needs a cookie). Compaction continues with the slower fallback summary — no messages were dropped. Details: the warm_compaction lines in logs/agent.log."
+ "🗜️ Compacting context — summarizing earlier conversation so I can continue...\n⚠ Warm compaction unavailable: the last 3 compactions did not use the warm summary (provider_error: the server refused the warm request (a provider error, or a gateway that needs a cookie)). Compaction continues with the fallback summary. Details: the warm_compaction lines in logs/agent.log."
],
"status_count": 13,
"log_counts": {
@@ -899,8 +900,8 @@
"errors_notice": 1
},
"fence_denied": {
- "network_host_blocked": 1,
- "child_process_blocked": 7
+ "child_process_blocked": 5,
+ "network_host_blocked": 1
},
"fence_blocked_programs": [
"git",
@@ -912,8 +913,7 @@
"hermes-assets.nousresearch.com"
],
"fence_blocked_callers": [
- "child_process_blocked from hermes_cli/local_runtime/processes.py:spawn_server < hermes_cli/_subprocess_compat.py:bounded_probe_run < hermes_cli/_subprocess_compat.py:bounded_git_probe",
- "child_process_blocked from hermes_cli/local_runtime/processes.py:spawn_server < hermes_cli/_subprocess_compat.py:bounded_probe_run < hermes_cli/_subprocess_compat.py:noninteractive_repo_git_env",
+ "child_process_blocked from hermes_cli/source_check.py:_git_run < hermes_cli/source_check.py:_git_stdout < hermes_cli/source_check.py:_read_checkout",
"child_process_blocked from tools/env_probe.py:_run < tools/env_probe.py:_py_out < tools/env_probe.py:_pip_python_version",
"child_process_blocked from tools/env_probe.py:_run < tools/env_probe.py:_py_out < tools/env_probe.py:_python_version_of",
"network_host_blocked from hermes_cli/release_channels.py:read < hermes_cli/release_channels.py:read_bytes < hermes_cli/release_channels.py:read_record"
@@ -1002,7 +1002,7 @@
"install",
"run"
],
- "process_seconds": 37.846
+ "process_seconds": 39.63
},
{
"scenario": "rollback",
@@ -1052,19 +1052,19 @@
"threshold_tokens": 100000,
"context_length": 200000
},
- "compress_seconds": 0.168,
+ "compress_seconds": 0.208,
"warm_last": {
"path": "warm",
"reason": "accepted",
- "elapsed_s": 0.016,
- "prompt_tokens": 33882,
- "cached_tokens": 16941
+ "elapsed_s": 0.031,
+ "prompt_tokens": 33845,
+ "cached_tokens": 16922
},
"session_rotated": false,
"final_session_id": "wc-rollback",
"continuation_keeps_custom_system_text": false,
"fence_denied": {
- "child_process_blocked": 4,
+ "child_process_blocked": 5,
"network_host_blocked": 1
},
"fence_blocked_programs": [
@@ -1215,8 +1215,7 @@
"stored": 30
},
"fence_denied": {
- "child_process_blocked": 5,
- "network_host_blocked": 1
+ "child_process_blocked": 5
},
"fence_blocked_programs": [
"git",
@@ -1224,9 +1223,7 @@
"python",
"python3"
],
- "fence_blocked_hosts": [
- "hermes-assets.nousresearch.com"
- ]
+ "fence_blocked_hosts": []
},
"exit": [
0,
@@ -1238,10 +1235,10 @@
"run",
"rollback"
],
- "process_seconds": 40.403
+ "process_seconds": 54.676
}
],
- "finished_utc": "2026-10-07T02:46:34Z",
+ "finished_utc": "2026-10-07T03:08:31Z",
"passed": true,
"run_folder": "outside repository"
}
diff --git a/scripts/check_plugin_hermes.py b/scripts/check_plugin_hermes.py
index 69df420..a4b8705 100644
--- a/scripts/check_plugin_hermes.py
+++ b/scripts/check_plugin_hermes.py
@@ -807,7 +807,11 @@ def run_auto_failures(agent, engine, history, server, result, checks, statuses,
checks["three_fallbacks_then_warm"] = outcomes == [["fallback", "provider_error"]] * 3 + [["warm", "accepted"]]
checks["one_notice"] = len(notices) == 1
checks["notice_before_the_fourth_compaction"] = notice_turn == 4
- checks["notice_names_the_reason"] = bool(notices) and "(provider_error)" in notices[0]
+ checks["notice_names_the_reason"] = bool(notices) and (
+ "provider_error: the server refused the warm request" in notices[0])
+ checks["notice_describes_the_summary_result"] = bool(notices) and "did not use the warm summary" in notices[0]
+ checks["notice_has_no_cache_or_retained_detail_claim"] = bool(notices) and not any(
+ claim in notices[0] for claim in ("could not reuse", "prompt cache", "slower", "no messages were dropped"))
logs = home / "logs"
def read_log(name):
path = logs / name
diff --git a/tests/test_wc_engine.py b/tests/test_wc_engine.py
index 77b3c56..317833d 100644
--- a/tests/test_wc_engine.py
+++ b/tests/test_wc_engine.py
@@ -603,23 +603,103 @@ class EngineTest(unittest.TestCase):
self.assertTrue(message.startswith("Compacting\n"))
# Hermes warning style on screen: the warning sign, a subject, what continues, and where to look.
notice = message.split("\n", 1)[1]
- self.assertTrue(notice.startswith("\u26a0 Warm compaction unavailable: the last 3 compactions could not "
- "reuse the prompt cache (no_capture)."))
+ self.assertTrue(notice.startswith("\u26a0 Warm compaction unavailable: the last 3 compactions did not "
+ "use the warm summary (no_capture:"))
self.assertIn("no main-model request completed", notice)
- self.assertIn("no messages were dropped", notice)
+ self.assertIn("Compaction continues with the fallback summary.", notice)
+ self.assertNotIn("slower", notice)
+ self.assertNotIn("no messages were dropped", notice)
self.assertIn("logs/agent.log", notice)
# One time only.
self.assertEqual(engine.get_automatic_compaction_status_message(phase="compress",
default_message="Compacting"), "Compacting")
+ def test_a_pending_notice_includes_a_later_fixed_summary(self):
+ engine = self.make()
+ history = [*old_turns(), assistant("done")]
+ with self.assertLogs("warm_compaction.engine", level="WARNING") as logs:
+ for _ in range(3):
+ engine.compress(history)
+ self.llm.error = RuntimeError("down")
+ engine.compress(history)
+ self.assertEqual(engine.warm_last["path"], "fixed")
+ notice = engine.get_automatic_compaction_status_message(phase="compress", default_message="Compacting")
+ self.assertIn("the last 4 compactions", notice)
+ self.assertIn("the fallback summary could not be used 1 of 4 times", notice)
+ self.assertIn("fixed summary (no model, less detail)", notice)
+ self.assertEqual(sum("Warm compaction skipped" in line for line in logs.output), 4)
+ self.assertEqual(sum("Warm compaction failed" in line for line in logs.output), 1)
+
+ def test_a_pending_notice_keeps_each_reason_with_its_hint(self):
+ engine = self.make()
+ rows, reply = old_turns(), assistant("final")
+ with self.assertLogs("warm_compaction.engine", level="WARNING") as logs:
+ for _ in range(2):
+ engine.compress([*rows, reply])
+ self.seed(rows, reply)
+ engine._post = fake_post(content="no headings")
+ engine.compress([*rows, reply])
+
+ def refused(*args, **kwargs):
+ raise RuntimeError("synthetic server refusal")
+
+ engine._post = refused
+ engine.compress([*rows, reply])
+ notice = engine.get_automatic_compaction_status_message(phase="compress", default_message="Compacting")
+ causes = (
+ "no_capture: no main-model request completed",
+ "gate:heading_missing: the warm reply failed the handoff checks",
+ "provider_error: the server refused the warm request",
+ )
+ for cause in causes:
+ self.assertEqual(notice.count(cause), 1)
+ self.assertLess(notice.index(causes[0]), notice.index(causes[1]))
+ self.assertLess(notice.index(causes[1]), notice.index(causes[2]))
+ self.assertIn("the last 4 compactions", notice)
+ self.assertEqual(sum("Warm compaction failed" in line for line in logs.output), 1)
+
+ def test_later_failures_do_not_repeat_a_consumed_notice(self):
+ engine = self.make()
+ history = [*old_turns(), assistant("done")]
+ with self.assertLogs("warm_compaction.engine", level="WARNING") as logs:
+ for _ in range(3):
+ engine.compress(history)
+ self.assertIn("Warm compaction unavailable", engine.get_automatic_compaction_status_message(
+ phase="compress", default_message="Compacting"))
+ self.llm.error = RuntimeError("down")
+ for _ in range(2):
+ engine.compress(history)
+ self.assertEqual(engine.get_automatic_compaction_status_message(
+ phase="compress", default_message="Compacting"), "Compacting")
+ self.assertEqual(sum("Warm compaction skipped" in line for line in logs.output), 5)
+ self.assertEqual(sum("Warm compaction failed" in line for line in logs.output), 1)
+
+ def test_a_rejected_warm_reply_with_cached_tokens_does_not_claim_a_cache_miss(self):
+ self.post = fake_post(content="no headings", cached=900)
+ engine = self.make()
+ rows, reply = old_turns(), assistant("final")
+ self.seed(rows, reply)
+ for _ in range(3):
+ engine.compress([*rows, reply])
+ self.assertEqual((engine.warm_last["path"], engine.warm_last["reason"],
+ engine.warm_last["cached_tokens"]), ("fallback", "gate:heading_missing", 900))
+ notice = engine.get_automatic_compaction_status_message(phase="compress", default_message="Compacting")
+ self.assertIn("did not use the warm summary", notice)
+ self.assertNotIn("could not reuse", notice)
+ self.assertNotIn("prompt cache", notice)
+ self.assertIn("gate:heading_missing: the warm reply failed the handoff checks", notice)
+
def test_a_warm_compaction_ends_the_failure_streak(self):
engine = self.make()
rows, reply = old_turns(), assistant("final")
- for _ in range(2):
+ for _ in range(3):
engine.compress([*rows, reply])
self.seed(rows, reply)
engine.compress([*rows, reply])
self.assertEqual(engine.warm_last["path"], "warm")
+ self.assertEqual((engine._warm_failures, engine._warm_fixed, engine._warm_failure_reasons), (0, 0, []))
+ self.assertEqual(engine.get_automatic_compaction_status_message(phase="compress",
+ default_message="Compacting"), "Compacting")
self.store.forget(session_id="s1")
for _ in range(2):
engine.compress([*rows, reply])
@@ -669,9 +749,9 @@ class EngineTest(unittest.TestCase):
self.assertEqual(engine.warm_last["path"], "fixed")
notice = engine.get_automatic_compaction_status_message(phase="compress", default_message="Compacting")
self.assertNotIn("continues with the slower fallback summary", notice)
- self.assertIn("the fallback summary also failed 3 of 3 times", notice)
+ self.assertIn("the fallback summary could not be used 3 of 3 times", notice)
self.assertIn("fixed summary", notice)
- self.assertIn("no messages were dropped", notice)
+ self.assertNotIn("no messages were dropped", notice)
self.assertEqual(sum("3 of them with the fixed summary" in line for line in logs.output), 1)
def test_a_session_reset_clears_the_failure_streak(self):
@@ -681,6 +761,7 @@ class EngineTest(unittest.TestCase):
for _ in range(3):
engine.compress(history)
engine.on_session_reset()
+ self.assertEqual((engine._warm_failures, engine._warm_fixed, engine._warm_failure_reasons), (0, 0, []))
self.assertEqual(engine.get_automatic_compaction_status_message(phase="compress",
default_message="Compacting"), "Compacting")
for _ in range(2):
diff --git a/warm_compaction/engine.py b/warm_compaction/engine.py
index 60d2631..2d40b11 100644
--- a/warm_compaction/engine.py
+++ b/warm_compaction/engine.py
@@ -45,6 +45,7 @@ FAILURE_HINTS = {
"credential_changed": "the API key changed after the last main request",
"capacity": "the warm request does not fit in the context window",
"summary_too_large": "the handoff did not fit in the free room of the context window",
+ "gate": "the warm reply failed the handoff checks",
"headers_unknown": "the route headers could not be read",
"tls_unknown": "the TLS settings of the route could not be read",
"middleware_after_capture": "another plugin middleware runs after the capture and can change the request",
@@ -658,9 +659,9 @@ class WarmCompactionEngine(ContextEngine):
def _note_warm_result(self, record: dict[str, Any]) -> None:
"""Count the compactions in a row without the warm path. Each one is a WARNING (errors.log has it too).
- After WARM_FAILURE_STREAK of them, one WARNING names the reasons and the cause, and the next automatic
- compaction status shows it to the user. A warm compaction ends the streak. A cancelled attempt is not a
- result, and the warm setting off is the user's choice: neither counts."""
+ After WARM_FAILURE_STREAK of them, one WARNING names the reasons and their hints. The next automatic
+ compaction status shows the notice. Until then, later failures update it. A warm compaction ends the
+ streak. A cancelled attempt and the warm setting off do not count."""
path, reason = record["path"], str(record["reason"])
if path == "warm":
if self._warm_failures >= WARM_FAILURE_STREAK:
@@ -673,24 +674,28 @@ class WarmCompactionEngine(ContextEngine):
self._warm_failures += 1
self._warm_fixed += path == "fixed"
self._warm_failure_reasons.append(reason)
- if self._warm_failures == WARM_FAILURE_STREAK:
+ if self._warm_failures >= WARM_FAILURE_STREAK and (
+ self._warm_failures == WARM_FAILURE_STREAK or self._warm_notice is not None):
reasons = ", ".join(dict.fromkeys(self._warm_failure_reasons))
- hint = FAILURE_HINTS.get(reason.split(":", 1)[0], "see the Limits section of the plugin README")
+ hints = "; ".join(
+ f"{item}: {FAILURE_HINTS.get(item.split(':', 1)[0], 'see the Limits section of the plugin README')}"
+ for item in dict.fromkeys(self._warm_failure_reasons))
# The fixed summary has no model request: when the fallback also failed, the notice says so.
if self._warm_fixed:
- continues = (f"Compaction continues, but the fallback summary also failed {self._warm_fixed} of "
+ continues = (f"Compaction continues, but the fallback summary could not be used {self._warm_fixed} of "
f"{self._warm_failures} times, so those used the fixed summary (no model, less detail)")
log_continues = f"compaction continues, {self._warm_fixed} of them with the fixed summary"
else:
- continues = "Compaction continues with the slower fallback summary"
+ continues = "Compaction continues with the fallback summary"
log_continues = "compaction continues with the fallback summary"
# The Hermes warning style on screen: the sign, the subject, what continues, and where to look.
self._warm_notice = (
- f"\u26a0 Warm compaction unavailable: the last {self._warm_failures} compactions could not reuse the "
- f"prompt cache ({reasons}). Likely cause: {hint}. {continues} \u2014 no messages were dropped. "
+ f"\u26a0 Warm compaction unavailable: the last {self._warm_failures} compactions did not use the "
+ f"warm summary ({hints}). {continues}. "
"Details: the warm_compaction lines in logs/agent.log.")
- logger.warning("Warm compaction failed %d times in a row (%s): %s; %s", self._warm_failures, reasons,
- hint, log_continues)
+ if self._warm_failures == WARM_FAILURE_STREAK:
+ logger.warning("Warm compaction failed %d times in a row (%s): %s; %s", self._warm_failures, reasons,
+ hints, log_continues)
def get_automatic_compaction_status_message(self, *, phase: str, default_message: str,
**context: Any) -> str | None: