Skip to content

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

Cut reasoning only on a known sending route, match whole Hermes templates, fit the request after the tail cut

Elevatormusic4fb1ac65de20
diff --git a/README.md b/README.md
index 1663289..9dcfc4b 100644
--- a/README.md
+++ b/README.md
@@ -201,7 +201,7 @@ The plugin was faster than both other engines in 10 of 10 cases. hermes-lcm and
- A provider or API key switch forgets the capture of the session: the next compaction uses the fallback summary (`no_capture`) until a main request on the new configuration completes.
- A captured row with a field that Hermes does not send for the stored row (other than the prompt caching marker `cache_control`) refuses the warm path (`source_transform_unsupported`).
- The handoff must start with `## Goal`: text before the first heading is refused (`gate:heading_preamble`).
-- The verbatim tail keeps the newest rows that fit in `tail_tokens`, and in the free room after the system rows and tool schemas of a usable capture, the reply reserve, and a summary: a large system prompt can make a short history compact. It stops at the first older row that does not fit, and that row goes into the summary. When the newest unit alone is larger than the tail or the free room, its largest sent payloads keep only their start and end: message text, tool call arguments (kept as a JSON object), and reasoning text. A large image or other media part is replaced by its attachment mark: a web URL or a file name stays (at most 200 characters), a data URL does not. If the cuts are not enough, the payloads are dropped, largest first; only the row structure stays. Signed `reasoning_details` stay as they are. The fallback summary gets the cut middles, and the fixed summary quotes them (at most 8,000 characters), also the cut middle of a long latest user message that goes in front of the tail. A fallback summary above its 4,096-token reserve (a dense CJK summary, for example) is not used: the fixed summary quotes the parts that the final tail cuts. Each quote makes the fixed summary larger and the tail smaller; after 10 rounds, the tail is cut at the size that the summary quotes, also when that is a little above the free room. The sizes come from the fields that Hermes sends: row metadata does not count; reasoning counts only on a route that needs it back (DeepSeek, Kimi, MiMo thinking; a capture of the route shows it, else a stored row with `reasoning_content`); `reasoning_details` counts only on a route that replays it, without the private native-assistant entries; a tool call counts only its id, type, name, and arguments, and a usable thought signature counts only for a Gemini or Gemma model. Reasoning that the route does not send is not cut: it does not go to the fallback model or into the fixed summary. The copied user messages get the room that stays after the tail is cut. Without a usable capture (after a restart, after a model change, or when a middleware changed the captured rows), the request overhead is unknown: the summary has no copied user messages, the tail takes at most half of the free room, the check before a request compacts when the history estimate reaches half of the window less the reply reserve, and the reply reserve is a quarter of the window (at most 65,536 and at least 4,096 tokens). The same reserve applies when the captured request had no positive `max_tokens` or `max_completion_tokens`: the provider default is not known. The host token count is not used for the overhead: it does not use the plugin tokenizer.
+- The verbatim tail keeps the newest rows that fit in `tail_tokens`, and in the free room after the system rows and tool schemas of a usable capture, the reply reserve, and a summary: a large system prompt can make a short history compact. It stops at the first older row that does not fit, and that row goes into the summary. When the newest unit alone is larger than the tail or the free room, its largest sent payloads keep only their start and end: message text, tool call arguments (kept as a JSON object), and reasoning text. A large image or other media part is replaced by its attachment mark: a web URL or a file name stays (at most 200 characters), a data URL does not. If the cuts are not enough, the payloads are dropped, largest first; only the row structure stays. Signed `reasoning_details` stay as they are. The fallback summary gets the cut middles, and the fixed summary quotes them (at most 8,000 characters), also the cut middle of a long latest user message that goes in front of the tail. A fallback summary above its 4,096-token reserve (a dense CJK summary, for example) is not used: the fixed summary quotes the parts that the final tail cuts. Each quote makes the fixed summary larger and the tail smaller; after 10 rounds, the tail is cut at the size that the summary quotes, also when that is a little above the free room. The sizes come from the fields that Hermes sends: row metadata does not count; reasoning counts only on a route that needs it back (DeepSeek, Kimi, MiMo thinking; a capture of the route shows it, else a stored row with `reasoning_content`); `reasoning_details` counts only on a route that replays it, without the private native-assistant entries; a tool call counts only its id, type, name, and arguments, and a usable thought signature counts only for a Gemini or Gemma model. Reasoning is cut only when a capture of the route shows that the route sends it: other reasoning (of an earlier route after a model switch, for example) does not go to the fallback model or into the fixed summary. The latest user request in front of the tail gets the room that stays after the tail is cut. Hermes notifications, task lists, and recovery nudges are not user requests only when the whole text matches the Hermes template. The copied user messages get the room that stays after the tail is cut. Without a usable capture (after a restart, after a model change, or when a middleware changed the captured rows), the request overhead is unknown: the summary has no copied user messages, the tail takes at most half of the free room, the check before a request compacts when the history estimate reaches half of the window less the reply reserve, and the reply reserve is a quarter of the window (at most 65,536 and at least 4,096 tokens). The same reserve applies when the captured request had no positive `max_tokens` or `max_completion_tokens`: the provider default is not known. The host token count is not used for the overhead: it does not use the plugin tokenizer.
- The warm request is not streamed and not retried. Its time limit is 120 seconds. The fallback request also has a 120-second limit.
- A request with `extra_headers` or `extra_query`, `n` above 1, a forced `tool_choice`, `response_format`, or audio settings uses the fallback (`settings_unsupported`).
- After `/compress`, Hermes builds the system prompt again from its configuration. A system message that a host gave in code is not kept. This is Hermes behavior, and it is the same for the built-in compressor.
diff --git a/evidence/plugin-integration.json b/evidence/plugin-integration.json
index ea07d03..22bee7c 100644
--- a/evidence/plugin-integration.json
+++ b/evidence/plugin-integration.json
@@ -1,6 +1,6 @@
{
"check": "standalone warm_compaction plugin on unpatched Hermes Agent",
- "started_utc": "2026-10-06T16:38:44Z",
+ "started_utc": "2026-10-06T16:53:19Z",
"hermes": {
"commit": "45871e100feceb89769536c88e5e6e265226a409",
"clean": true
@@ -10,12 +10,12 @@
"plugin_files_sha256": {
"warm_compaction/__init__.py": "11e038f05813627b2d1d8b82b3b775ecfe41015746c8e90ed6d452cfdaec65a6",
"warm_compaction/capture.py": "387a5bda2c97530c6e9114e810ac062199e3731c12a582d75598d2bdb95e8c57",
- "warm_compaction/engine.py": "c46e5ac2041599bb48983a7cfe990412cc1669ba9f2f834d9d71b55db31064a4",
+ "warm_compaction/engine.py": "03abb0768293540a566c377e69b8f2749800cbc7ce41054a19ceb1ec79e98f24",
"warm_compaction/fallback.py": "f4cf08186f38fc9a46f47af2bedf22584b6ede4f11de1c3abd0fd598aec2f8a4",
"warm_compaction/handoff.py": "9afea62ec2f8ef46cbeefd70b1071bb6c7111fa6fd1cd073e1fb2c7eae30f3c2",
- "warm_compaction/layout.py": "fc410c192acfbea60e2137172b9fcf82091f3b51c8a0c8e007bc363bb2dfd01b",
+ "warm_compaction/layout.py": "a75de1941a8527793ea1e142c986d4cb08150162a31a677ca99bb9c5d03be54c",
"warm_compaction/plugin.yaml": "d67560fd4625ec80d9e26f3e6d712763e77474f68d469c7e48f09fd3506ccc71",
- "warm_compaction/rows.py": "1eb0a043c060322769ad0e2533b3f1b30d5258f125502752d18b8a94c1006347",
+ "warm_compaction/rows.py": "acba1ae0bed41c38041d1149f825a5f2c6552d2dd20549266bd2c11f1da4ba50",
"warm_compaction/warm.py": "fe1f1b2e065f7198586979455ab54ed7dfd20d144b3751c3451d3cf6a70480e4"
},
"privacy": "metadata only: names, counts, codes, booleans, and times; no message text",
@@ -76,11 +76,11 @@
"threshold_tokens": 100000,
"context_length": 200000
},
- "compress_seconds": 0.114,
+ "compress_seconds": 0.099,
"warm_last": {
"path": "warm",
"reason": "accepted",
- "elapsed_s": 0.028,
+ "elapsed_s": 0.023,
"prompt_tokens": 33892,
"cached_tokens": 16946
},
@@ -189,7 +189,7 @@
"install",
"run"
],
- "process_seconds": 53.364
+ "process_seconds": 54.429
},
{
"scenario": "manual_fallback",
@@ -248,11 +248,11 @@
"threshold_tokens": 100000,
"context_length": 200000
},
- "compress_seconds": 0.282,
+ "compress_seconds": 0.236,
"warm_last": {
"path": "fallback",
"reason": "provider_error",
- "elapsed_s": 0.141,
+ "elapsed_s": 0.109,
"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": 5,
"network_host_blocked": 1
},
"fence_blocked_programs": [
@@ -361,7 +361,7 @@
"install",
"run"
],
- "process_seconds": 34.145
+ "process_seconds": 33.077
},
{
"scenario": "manual_fixed",
@@ -419,11 +419,11 @@
"threshold_tokens": 100000,
"context_length": 200000
},
- "compress_seconds": 0.26,
+ "compress_seconds": 0.231,
"warm_last": {
"path": "fixed",
"reason": "provider_error",
- "elapsed_s": 0.125,
+ "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": 33.99
+ "process_seconds": 30.113
},
{
"scenario": "auto_tool_loop",
@@ -633,8 +633,8 @@
},
"compression_count": 2,
"fence_denied": {
- "child_process_blocked": 8,
- "network_host_blocked": 1
+ "network_host_blocked": 1,
+ "child_process_blocked": 7
},
"fence_blocked_programs": [
"git",
@@ -648,7 +648,6 @@
"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"
@@ -737,7 +736,7 @@
"install",
"run"
],
- "process_seconds": 35.991
+ "process_seconds": 33.11
},
{
"scenario": "rollback",
@@ -787,7 +786,7 @@
"threshold_tokens": 100000,
"context_length": 200000
},
- "compress_seconds": 0.14,
+ "compress_seconds": 0.142,
"warm_last": {
"path": "warm",
"reason": "accepted",
@@ -973,10 +972,10 @@
"run",
"rollback"
],
- "process_seconds": 39.347
+ "process_seconds": 37.884
}
],
- "finished_utc": "2026-10-06T16:42:01Z",
+ "finished_utc": "2026-10-06T16:56:28Z",
"passed": true,
"run_folder": "outside repository"
}
diff --git a/tests/test_wc_engine.py b/tests/test_wc_engine.py
index 0e53a62..3f50595 100644
--- a/tests/test_wc_engine.py
+++ b/tests/test_wc_engine.py
@@ -738,6 +738,31 @@ class EngineTest(unittest.TestCase):
summary = "\n".join(str(row["content"]) for row in new if row.get("_compressed_summary"))
self.assertIn("ask 0 ", summary)
+ def test_reasoning_of_an_earlier_route_does_not_reach_the_fallback_model(self):
+ # No capture of this route: old rows with reasoning_content (of a thinking route before a model switch)
+ # do not show that this route sends it.
+ rows = [*old_turns(4), user("go"),
+ assistant("c" * 40_000, reasoning_content="r" * 40_000 + " SECRET " + "r" * 40_000)]
+ engine = self.make(threshold=0.95, tail_tokens=2_000, warm=False)
+ engine.compress(rows)
+ self.assertEqual(engine.warm_last["path"], "fallback")
+ sent = json.dumps([call[0] for call in self.llm.calls])
+ self.assertNotIn("SECRET", sent)
+ self.assertNotIn("r" * 100, sent)
+
+ def test_the_prepended_request_is_fitted_against_the_bounded_tail(self):
+ # A huge tool result is cut to the tail cap: the room after it keeps the whole active request.
+ request = "REQ start " + "q" * 6_000 + " REQ end"
+ rows = [*old_turns(4), user(request)]
+ reply = assistant("", [("c1", "read", "{}")])
+ self.seed(rows, reply)
+ engine = self.make(threshold=0.95, warm=False)
+ engine.update_model(model=ROUTE[0], context_length=64_000, base_url=ROUTE[1], api_key="k",
+ provider="custom", api_mode=ROUTE[2])
+ new = engine.compress([*rows, reply, tool("c1", "t" * 400_000)])
+ self.assertEqual(engine.warm_last["path"], "fallback")
+ self.assertTrue(any(row.get("role") == "user" and row.get("content") == request for row in new))
+
def test_unsent_reasoning_does_not_reach_the_fallback_model(self):
# The route does not send reasoning: the auxiliary model must not get the private reasoning of a cut row.
rows = [*old_turns(4), user("go"), assistant("c" * 40_000, reasoning="r" * 40_000 + " SECRET " + "r" * 40_000)]
diff --git a/tests/test_wc_layout.py b/tests/test_wc_layout.py
index 000ac12..d5952b8 100644
--- a/tests/test_wc_layout.py
+++ b/tests/test_wc_layout.py
@@ -16,13 +16,21 @@ def build_with(rows, start, prepend=None, summary="S"):
prefixes=PREFIXES, end_marker=END)
+DROPPED_TOOLS_TEXT = (
+ "[System: Your previous tool call (write_file) was too large and the stream timed out before it could be "
+ "delivered. Do NOT retry the same tool call with the same large content. Instead, break the content into "
+ "multiple smaller tool calls (e.g. use multiple patch calls or write smaller files). Each tool call's arguments "
+ "must be under ~8K tokens to avoid stream timeouts. The cut was a transport interruption, not a capability "
+ "change \u2014 your tools remain fully available.]")
+
+
class PredicateTest(unittest.TestCase):
def test_real_user_excludes_scaffolding_and_summaries(self):
self.assertTrue(is_real_user(user("hi"), PREFIXES))
self.assertTrue(is_real_user(user("x", display_kind="steer"), PREFIXES))
for row in (user("x", _todo_snapshot_synthetic=True), user("x", _dropped_toolcall_nudge=True),
user("x", display_kind="hidden"), user(" "), user("[HERMES PREFIX]\n\n" + HEADER_TEXT),
- user("x", _compressed_summary=True), user("[System: Your previous tool call failed"),
+ user("x", _compressed_summary=True), user(DROPPED_TOOLS_TEXT),
assistant("hi")):
with self.subTest(row=row):
self.assertFalse(is_real_user(row, PREFIXES))
@@ -42,6 +50,33 @@ class PredicateTest(unittest.TestCase):
self.assertFalse(is_real_user(user(" " + text + "\n"), PREFIXES))
self.assertTrue(is_real_user(user("Continue now."), PREFIXES))
+ def test_hermes_scaffolding_rows_match_their_whole_template(self):
+ # Hermes writes these rows from fixed templates. A user message that only starts like one (a pasted log,
+ # for example) is a real request.
+ scaffolding = (
+ DROPPED_TOOLS_TEXT,
+ "[IMPORTANT: Background process proc_1 completed normally (exit code 0).\nCommand: make\nOutput:\nok]",
+ "[IMPORTANT: Background process proc_1 exited (exit code 2, SIGTERM).\nDelegated by task 7\n"
+ "Command: make test\nOutput:\nline 1\nline 2]",
+ "[IMPORTANT: Background process proc_2 matched watch pattern \"ERROR\".\nCommand: tail -f log\n"
+ "Matched output:\nERROR x\n(2 earlier matches were suppressed by rate limit)]",
+ "[Your active task list was preserved across context compression]\n- [>] 1. Fix the parser (in_progress)\n"
+ " - [ ] 2. Add a test (pending)",
+ )
+ for text in scaffolding:
+ with self.subTest(text=text[:40]):
+ self.assertFalse(is_real_user(user(text), PREFIXES))
+ real = (
+ "[IMPORTANT: Background process ids in this log are wrong. Please fix the parser.",
+ "[System: Your previous tool call log follows; why did it fail?\n...",
+ "[Your active task list was preserved across context compression] is shown twice; remove one.",
+ "[System: Your previous response was truncated in the UI. Explain why.",
+ "[System: The previous response was cut off at 4K. Is that the limit?",
+ )
+ for text in real:
+ with self.subTest(text=text[:40]):
+ self.assertTrue(is_real_user(user(text), PREFIXES))
+
def test_summary_detection(self):
# Without the flag (the Hermes session store drops it), only the whole carrier is a summary: a prefix and
# the end marker, or the plugin header row.
@@ -224,6 +259,17 @@ class BoundTailTest(unittest.TestCase):
rows = [user("o" * 4_000), assistant("a"), user("q"), assistant("b", reasoning="r" * 40_000)]
self.assertEqual(tail_start(rows, 900, PREFIXES, SendPolicy(echo=False)), (2, None))
+ def test_reasoning_is_not_cut_when_the_route_is_not_known_to_send_it(self):
+ # Without a capture of this route, stored reasoning_content can be of an earlier route: it is counted, but
+ # not cut and not given to the fallback.
+ from warm_compaction.layout import bound_tail
+ from warm_compaction.rows import SendPolicy
+ rows = [user("go"), assistant("c" * 20_000, reasoning_content="r" * 30_000 + " SECRET " + "r" * 30_000)]
+ removed = []
+ bounded = bound_tail(rows, 2_000, removed, SendPolicy(echo=True, cut_reasoning=False))
+ self.assertEqual(bounded[1]["reasoning_content"], rows[1]["reasoning_content"])
+ self.assertNotIn("SECRET", str(removed))
+
def test_unsent_reasoning_is_not_cut_or_given_back(self):
# A route that does not send reasoning: the private reasoning must not go to the fallback model or into
# the fixed summary.
diff --git a/warm_compaction/engine.py b/warm_compaction/engine.py
index d48dc3b..1d6c75e 100644
--- a/warm_compaction/engine.py
+++ b/warm_compaction/engine.py
@@ -276,8 +276,11 @@ class WarmCompactionEngine(ContextEngine):
summary = fallback.fixed_summary([*messages[:start], *removed], prefixes)
record["path"] = "fixed"
# The prepended user row must be in the tail: when it does not fit in the room, keep its start and end.
- # With an unknown overhead, the room is unknown too: the row keeps only its minimum.
- room = self._room(messages[start:], summary, overhead or 0, reserve, policy)
+ # With an unknown overhead, the room is unknown too: the row keeps only its minimum. The room is after the
+ # tail as the cap cuts it: an uncut large tool result would leave no room.
+ bounded = layout.bound_tail(messages[start:], self._tail_cap(estimate_tokens(summary), overhead, reserve),
+ policy=policy)
+ room = self._room(bounded, summary, overhead or 0, reserve, policy)
cut: list = []
if prepend is not None and room is not None:
allowed = room if overhead is not None else 0
@@ -333,7 +336,8 @@ class WarmCompactionEngine(ContextEngine):
else warm.needs_reasoning_echo({}, messages))
module = "agent.transports.chat_completions"
return SendPolicy(
- echo=echo,
+ # Without a capture, stored reasoning can be of an earlier route: count it, but do not cut it.
+ echo=echo, cut_reasoning=echo and bool(sent),
details=bool(hermes_value(module, "_route_replays_reasoning_details",
warm._route_replays_reasoning_details)(self._wc_route[1])),
signatures=bool(hermes_value(module, "_model_consumes_thought_signature",
diff --git a/warm_compaction/layout.py b/warm_compaction/layout.py
index e0acde5..8b11d5f 100644
--- a/warm_compaction/layout.py
+++ b/warm_compaction/layout.py
@@ -4,6 +4,7 @@ from __future__ import annotations
import copy
import functools
+import re
from typing import Any, Iterable
from .handoff import END_MARKER, LEGACY_PREFIX
@@ -20,12 +21,24 @@ CUT_NOTE = "[The middle of a newest row; its start and end stay after the summar
NO_COPIES = "(none)"
STEER_KIND = "steer"
SYNTHETIC_FLAGS = ("_dropped_toolcall_nudge",)
-SYNTHETIC_PREFIXES = (
- "[System: Your previous response was truncated",
- "[System: The previous response was cut off",
- "[System: Your previous tool call",
- "[Your active task list was preserved across context compression]",
- "[IMPORTANT: Background process ",
+# Hermes 45871e10 rows from templates with variable parts: the whole text must match the template (Hermes itself
+# matches only the start; a user message that only starts like one is a real request). The fixed nudges are in
+# HOST_NUDGES.
+_DROPPED_TOOLS_TAIL = (
+ " was too large and the stream timed out before it could be delivered. Do NOT retry the same tool call with "
+ "the same large content. Instead, break the content into multiple smaller tool calls (e.g. use multiple patch "
+ "calls or write smaller files). Each tool call's arguments must be under ~8K tokens to avoid stream timeouts. "
+ "The cut was a transport interruption, not a capability change \u2014 your tools remain fully available.]")
+SYNTHETIC_TEMPLATES = (
+ # agent.conversation_loop._get_continuation_prompt, with the dropped tool names.
+ re.compile(re.escape("[System: Your previous tool call ") + r"\([^\n]*\)" + re.escape(_DROPPED_TOOLS_TAIL)),
+ # tools.process_registry_notifications.format_process_notification (and the gateway copy): a completion or a
+ # watch match, an optional attribution line, the command, and the output.
+ re.compile(r'\[IMPORTANT: Background process \S+ (?:matched watch pattern "[^\n]*"|[^\n]*\(exit code [^\n]*\))'
+ r"\.\n(?:[^\n]*\n)?Command: [^\n]*\n(?:Matched output|Output):\n.*\]", re.S),
+ # tools.todo_tool.TodoStore.format_for_injection: the header and one line for each task.
+ re.compile(re.escape("[Your active task list was preserved across context compression]")
+ + r"(?:\n *- \[[^\]\n]*\] [^\n]*)+"),
)
# Hermes recovery nudges and continuation markers. The Hermes compressor matches them by exact text
# (ContextCompressor._is_synthetic_compression_user_turn). The Hermes value applies when Hermes has it; the
@@ -126,7 +139,7 @@ def is_real_user(row: Any, prefixes: Iterable[str]) -> bool:
if row.get("display_kind") and row.get("display_kind") != STEER_KIND:
return False
text = visible_text(row.get("content")).strip()
- if not text or text.startswith(SYNTHETIC_PREFIXES) or text in nudge_texts():
+ if not text or text in nudge_texts() or any(template.fullmatch(text) for template in SYNTHETIC_TEMPLATES):
return False
return not is_summary(row, prefixes)
@@ -287,7 +300,7 @@ def _tail_parts(row: Any, policy: SendPolicy = SendPolicy()) -> list[tuple[tuple
if isinstance(function, dict) and function.get("arguments") is not None:
arguments = function["arguments"]
parts.append((("arguments", index), arguments if isinstance(arguments, str) else compact_json(arguments)))
- key = sent_reasoning_key(row, policy)
+ key = sent_reasoning_key(row, policy) if policy.cut_reasoning else None
if key is not None:
parts.append(((key,), row[key]))
return parts
diff --git a/warm_compaction/rows.py b/warm_compaction/rows.py
index 967f7ec..4baad50 100644
--- a/warm_compaction/rows.py
+++ b/warm_compaction/rows.py
@@ -108,10 +108,13 @@ SENT_FIELDS = ("role", "content", "name", "tool_call_id", "reasoning_content")
class SendPolicy(NamedTuple):
"""The route-dependent fields of warm.wire_row: reasoning_details (a route that replays them), the tool-call
thought signature, extra_content (a model that reads it), and reasoning_content (a route that needs it back,
- apply_reasoning_content_policy). The default counts all of them."""
+ apply_reasoning_content_policy). The default counts all of them. cut_reasoning: a cut can take reasoning
+ (layout.bound_tail) only when a capture of the route shows that the route sends it; else stored reasoning can
+ be of an earlier route, and a cut would give it to the fallback model."""
details: bool = True
signatures: bool = True
echo: bool = True
+ cut_reasoning: bool = True
def reasoning_policy(source: dict, wire: dict, needs_pad: bool) -> None: