The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(context): sync Tameru 1.4.1 and preserve Hermes call contracts
thewhitemage.475e0d0120e1
diff --git a/plugins/context_engine/extractive/plugin.yaml b/plugins/context_engine/extractive/plugin.yamlindex 2be32376e20..44b9f67d0b2 100644--- a/plugins/context_engine/extractive/plugin.yaml+++ b/plugins/context_engine/extractive/plugin.yaml@@ -1,4 +1,4 @@name: extractivedisplay_name: Tameru compatibility aliasdescription: "Deprecated compatibility alias; migrate context.engine to tameru"-version: 1.4.0+version: 1.4.1diff --git a/plugins/context_engine/tameru/CHANGELOG.md b/plugins/context_engine/tameru/CHANGELOG.mdnew file mode 100644index 00000000000..82ac8711fac--- /dev/null+++ b/plugins/context_engine/tameru/CHANGELOG.md@@ -0,0 +1,12 @@+# Tameru Hermes adapter changelog++## 1.4.1 source update — 2026-10-12++- Synchronise vendored engine modules and both Tameru/legacy-extractive manifests to the upstream 1.4.1 source at `e7e32866ded56071af13fd5fb91a2214c1b3c018`. Engine tag/Release publication remains pending.+- Forward Hermes compression keyword arguments, including `bypass_cooldown`, to the parent compressor. The previous signature raised TypeError during an overflow cooldown override.+- Build relevance queries from the text parts of multimodal user content, excluding image payloads, in both proactive pruning and full compression. An explicit focus topic still takes precedence.+- Add two regression tests through the real context-engine discovery path; both failed on the previous adapter and pass after the fixes.++Verification on Python 3.14: 322 Hermes tests passed across the adapter, context engine/compressor, focus, plugin init/discovery and manual compression. Ruff and compile checks pass; the upstream vendor drift check is clean. Upstream engine: 1,168 passed / 3 skipped, production battery 15/15.++This adapter retains the existing preliminary transcript-prune and summary-validation design. It does not include the standalone plugin's per-result ladder, `tameru_expand` store or artifact ledger, and it is not merged into Hermes main by this update.diff --git a/plugins/context_engine/tameru/__init__.py b/plugins/context_engine/tameru/__init__.pyindex e9f73ac1cc3..2c706a652b8 100644--- a/plugins/context_engine/tameru/__init__.py+++ b/plugins/context_engine/tameru/__init__.py@@ -10,6 +10,7 @@ from .hermes_extractive_engine import (bulky_tools_dropped,query_facts_lost,)+from .transcript import last_user_textclass ExtractiveContextEngine(ContextCompressor):@@ -36,11 +37,7 @@ class ExtractiveContextEngine(ContextCompressor):super().__init__(model=model, **kwargs)def prune_tool_results_only(self, messages, current_tokens=None):- query = ""- for msg in reversed(messages or []):- if msg.get("role") == "user":- query = str(msg.get("content") or "")- break+ query = last_user_text(messages)pruned, changed = apply_extractive_tool_prune(messages, query)more, parent_changed = super().prune_tool_results_only(pruned, current_tokens)return more, changed + parent_changed@@ -52,13 +49,9 @@ class ExtractiveContextEngine(ContextCompressor):focus_topic=None,force=False,memory_context="",+ **kwargs: Any,):- query = focus_topic or ""- if not query:- for msg in reversed(messages or []):- if msg.get("role") == "user":- query = str(msg.get("content") or "")- break+ query = focus_topic or last_user_text(messages)pruned, _changed = apply_extractive_tool_prune(messages, query)summarised = super().compress(pruned,@@ -66,6 +59,7 @@ class ExtractiveContextEngine(ContextCompressor):focus_topic=focus_topic,force=force,memory_context=memory_context,+ **kwargs,)if query_facts_lost(messages, summarised, query) or bulky_tools_dropped(pruned, summariseddiff --git a/plugins/context_engine/tameru/compress_context.py b/plugins/context_engine/tameru/compress_context.pyindex e83cf8dfc9e..881aa84e223 100644--- a/plugins/context_engine/tameru/compress_context.py+++ b/plugins/context_engine/tameru/compress_context.py@@ -62,7 +62,7 @@ except Exception:DEFAULT_CCR_DIR = Path(tempfile.gettempdir()) / ".tameru" / "cache" / "context-compress-ccr"# Engine release this module ships in; the release bump keeps it in step with# pyproject.toml and src/tameru/__init__.py.-ENGINE_VERSION = "1.4.0"+ENGINE_VERSION = "1.4.1"CCR_TTL_SECONDS = 6 * 60 * 60CCR_MAX_CLOCK_SKEW_SECONDS = 5 * 60FREEZE_MAX_DECISIONS = 4096diff --git a/plugins/context_engine/tameru/plugin.yaml b/plugins/context_engine/tameru/plugin.yamlindex 8b4640cab0e..a5a4133ec46 100644--- a/plugins/context_engine/tameru/plugin.yaml+++ b/plugins/context_engine/tameru/plugin.yaml@@ -1,4 +1,4 @@name: tamerudisplay_name: Tameru (貯める)-description: "Tameru 1.4.0 industrial deterministic context compaction"-version: 1.4.0+description: "Tameru 1.4.1 industrial deterministic context compaction"+version: 1.4.1diff --git a/tests/plugins/test_tameru_context_engine.py b/tests/plugins/test_tameru_context_engine.pynew file mode 100644index 00000000000..6e54a3c935d--- /dev/null+++ b/tests/plugins/test_tameru_context_engine.py@@ -0,0 +1,32 @@+"""Tameru's discovered adapter preserves Hermes call options and text-only queries."""++from unittest.mock import patch++from agent.context_compressor import ContextCompressor+from plugins.context_engine import load_context_engine+++def test_compress_forwards_overflow_cooldown_override():+ engine = load_context_engine("tameru")+ assert engine is not None+ messages = [{"role": "user", "content": "Find the deployment error"}]+ with patch.object(ContextCompressor, "compress", return_value=messages) as parent:+ assert engine.compress(messages, bypass_cooldown=True) == messages+ assert parent.call_args.kwargs["bypass_cooldown"] is True+++def test_multimodal_user_query_excludes_image_payload_in_both_paths():+ engine = load_context_engine("tameru")+ assert engine is not None+ messages = [{"role": "user", "content": [+ {"type": "text", "text": "Find DB-PROD-42"},+ {"type": "image_url", "image_url": {"url": "data:image/png;base64,AAAA"}},+ ]}]+ with (+ patch("plugins.context_engine.tameru.apply_extractive_tool_prune", return_value=(messages, 0)) as prune,+ patch.object(ContextCompressor, "prune_tool_results_only", return_value=(messages, 0)),+ patch.object(ContextCompressor, "compress", return_value=messages),+ ):+ engine.prune_tool_results_only(messages)+ engine.compress(messages)+ assert [call.args[1] for call in prune.call_args_list] == ["Find DB-PROD-42"] * 2