The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(compaction): own the bench probe deadline load in PreLlmSkipMixin
kshitijk4poor1a8fb8c917f1
diff --git a/agent/context_compressor.py b/agent/context_compressor.pyindex 0b6426c2487..ed85d987665 100644--- a/agent/context_compressor.py+++ b/agent/context_compressor.py@@ -32,7 +32,7 @@ from agent.auxiliary_client import (extract_content_or_reasoning,)from agent.context_engine import ContextEngine, sanitize_memory_context-from agent.context_compressor_prellm import FALLBACK_PROBE_AT_MODEL_CONFIG_KEY, PreLlmSkipMixin+from agent.context_compressor_prellm import PreLlmSkipMixinfrom agent.context_compressor_summary import SummaryDispatchMixinfrom agent.error_classifier import FailoverReason, classify_api_errorfrom agent.micro_compaction import MicroCompactionMixin@@ -2429,10 +2429,7 @@ class ContextCompressor(SummaryDispatchMixin, PreLlmSkipMixin, MicroCompactionMiself._load_fallback_compression_streak()self._load_ineffective_compression_count()self._load_anti_thrash_recovery_deadline()- self._load_durable(- "_fallback_probe_at", "get_session_model_config_value", "summary-model probe deadline",- float, 0.0, FALLBACK_PROBE_AT_MODEL_CONFIG_KEY, 0.0,- )+ self._load_fallback_probe_at()self._load_consecutive_overload_aborts()self._load_proactive_prune_rearm_tokens()diff --git a/agent/context_compressor_prellm.py b/agent/context_compressor_prellm.pyindex e3487b8605d..3822971b1c5 100644--- a/agent/context_compressor_prellm.py+++ b/agent/context_compressor_prellm.py@@ -14,7 +14,7 @@ logger = logging.getLogger(__name__)# threshold (and a prior ineffectiveness strike exists); dropping alone suffices.# See #60451._FEASIBILITY_SKIP_MIDDLE_FRACTION = 0.10-FALLBACK_PROBE_AT_MODEL_CONFIG_KEY = "_fallback_probe_at"+_FALLBACK_PROBE_AT_MODEL_CONFIG_KEY = "_fallback_probe_at"class PreLlmSkipMixin:@@ -27,7 +27,13 @@ class PreLlmSkipMixin:returnself._fallback_probe_at = atself._durable_write(- "patch_session_model_config", "summary-model probe deadline", {FALLBACK_PROBE_AT_MODEL_CONFIG_KEY: at or None},+ "patch_session_model_config", "summary-model probe deadline", {_FALLBACK_PROBE_AT_MODEL_CONFIG_KEY: at or None},+ )++ def _load_fallback_probe_at(self) -> None:+ self._load_durable(+ "_fallback_probe_at", "get_session_model_config_value", "summary-model probe deadline",+ float, 0.0, _FALLBACK_PROBE_AT_MODEL_CONFIG_KEY, 0.0,)def _fallback_streak_skip(self, telemetry: Dict[str, Any]) -> bool: