diff --git a/amplifier_module_context_simple/__init__.py b/amplifier_module_context_simple/__init__.py index ab57c14..f40ab90 100644 --- a/amplifier_module_context_simple/__init__.py +++ b/amplifier_module_context_simple/__init__.py @@ -1001,6 +1001,11 @@ async def _finalize_compaction_with_stats( "target_tokens": target_tokens, "protected_recent": self.protected_recent, "protected_tool_results": self.protected_tool_results, + "metadata": { + "reason": "token_threshold_exceeded", + "threshold": self.compact_threshold, + "usage_ratio": old_tokens / budget if budget > 0 else 0, + }, } self._last_compaction_stats = stats