The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(compression): import _safe_int from its new home instead of re-exporting it
kshitijk4poor4eaa67e9018a
diff --git a/agent/context_compressor.py b/agent/context_compressor.pyindex 77a1c06473a..6e829eaf82d 100644--- a/agent/context_compressor.py+++ b/agent/context_compressor.py@@ -33,7 +33,7 @@ from agent.auxiliary_client import (from agent.context_engine import ContextEngine, sanitize_memory_contextfrom agent.context_compressor_prellm import PreLlmSkipMixinfrom agent.context_compressor_summary import SummaryDispatchMixin-from agent.context_compressor_telemetry import CompressionTelemetryMixin, _safe_int+from agent.context_compressor_telemetry import CompressionTelemetryMixinfrom agent.error_classifier import FailoverReason, classify_api_errorfrom agent.micro_compaction import MicroCompactionMixinfrom agent.prompt_builder import STEER_DISPLAY_KINDdiff --git a/agent/micro_compaction.py b/agent/micro_compaction.pyindex 5fd5ffa3ceb..42cad0c2d82 100644--- a/agent/micro_compaction.py+++ b/agent/micro_compaction.py@@ -12,6 +12,7 @@ import timefrom typing import Any, Dict, List, Optionalfrom agent.compaction_events import publish_micro+from agent.context_compressor_telemetry import _safe_intfrom agent.message_metadata import record_absorbed_messagefrom agent.model_metadata import estimate_messages_tokens_rough, estimate_tokens_rough@@ -349,7 +350,6 @@ class MicroCompactionMixin:) -> None:"""Emit one content-free JSON log line for a micro-compaction pass.``tokens_delta`` < 0 means the pass shrank the transcript; ``*_total`` fields accumulate."""- _safe_int = _cc()._safe_inttry:delta = tokens_after - tokens_before if tokens_before is not None and tokens_after is not None else Noneself._micro_compact_tokens_saved_total -= delta or 0