From 74ae2d3bf2438e58dec5b78ee7b2207de31f0226 Mon Sep 17 00:00:00 2001 From: xxxigm Date: Mon, 27 Jul 2026 18:57:05 +0700 Subject: [PATCH] fix(compression): default in_place to True to match DEFAULT_CONFIG is_truthy_value(..., default=False) and getattr(..., False) disagreed with compression.in_place: true from #38763, so partial/failed config loads fell back into rotation mode and re-armed the pre-lease drift path. Also report compression.in_place in hermes dump overrides so stale false values are visible. --- agent/agent_init.py | 6 +++++- hermes_cli/dump.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/agent/agent_init.py b/agent/agent_init.py index 69d814f47dcc..95161f8cdee5 100644 --- a/agent/agent_init.py +++ b/agent/agent_init.py @@ -1952,8 +1952,12 @@ def init_agent( # parent_session_id chain, no `name #N` renumber). See #38763 and # agent/conversation_compression.py. Consumed by compress_context(), not the # compressor, so it rides on the agent. + # Default True must match DEFAULT_CONFIG["compression"]["in_place"] + # (#38763). default=False here previously flipped agents into rotation + # mode whenever the merged config omitted the key (partial configs, + # load_config failure → {}), re-arming the pre-lease drift abort. compression_in_place = is_truthy_value( - _compression_cfg.get("in_place"), default=False + _compression_cfg.get("in_place"), default=True ) codex_app_server_auto_compaction = str( _compression_cfg.get("codex_app_server_auto", "native") or "native" diff --git a/hermes_cli/dump.py b/hermes_cli/dump.py index 9b6685ae5e7c..e8ed12963e69 100644 --- a/hermes_cli/dump.py +++ b/hermes_cli/dump.py @@ -243,6 +243,7 @@ def _config_overrides(config: dict) -> dict[str, str]: ("browser", "allow_private_urls"), ("compression", "enabled"), ("compression", "threshold"), + ("compression", "in_place"), ("display", "streaming"), ("display", "skin"), ("display", "show_reasoning"),