The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(compression): import the codex cooldown lookup at module level
kshitijk4poor5b3c8b3240c8
diff --git a/agent/client_lifecycle.py b/agent/client_lifecycle.pyindex 892ac952165..4ce4e539d01 100644--- a/agent/client_lifecycle.py+++ b/agent/client_lifecycle.py@@ -930,7 +930,6 @@ class ClientLifecycleMixin:rt[k] = new_token# The turn's aux runtime was published before the first request triggered this refresh, so# same-turn `auto` aux calls (approvals, goal judge, plugin llm) would still send the revoked token.- # Mutated in place: the refresh may run in a request worker's copied Context.from agent.auxiliary_key_rotation import rotate_runtime_main_api_keyrotate_runtime_main_api_key(old_token, new_token)return Truediff --git a/agent/conversation_compression.py b/agent/conversation_compression.pyindex 9edc9711b64..7f7e0281d05 100644--- a/agent/conversation_compression.py+++ b/agent/conversation_compression.py@@ -30,6 +30,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Tuplefrom agent.auxiliary_client import AuxiliaryExplicitCancellationfrom agent.context_engine import automatic_compaction_status_message, sanitize_memory_context+from agent.conversation_compression_codex import _codex_compaction_cooldown_remainingfrom agent.conversation_compression_telemetry import _emit_aborted_attempt_telemetry, _emit_compression_attempt_telemetryfrom agent.memory_provider import PRE_COMPRESS_CHECKPOINT_API_VERSIONfrom agent.model_metadata import estimate_messages_tokens_rough, estimate_request_tokens_rough@@ -4329,7 +4330,6 @@ def _compress_context_via_codex_app_server(elif not force:# Automatic entrypoints honor the compressor-owned cooldown: a recent compaction# failed, and retrying every turn is what thrashes.- from agent.conversation_compression_codex import _codex_compaction_cooldown_remaining_cooldown_remaining = _codex_compaction_cooldown_remaining(agent)if _cooldown_remaining > 0:skip_reason = f"failure cooldown active for {_cooldown_remaining:.0f}s"diff --git a/agent/conversation_compression_codex.py b/agent/conversation_compression_codex.pyindex 5db8b095f41..b1700cfae93 100644--- a/agent/conversation_compression_codex.py+++ b/agent/conversation_compression_codex.py@@ -1,6 +1,6 @@"""Codex app-server compaction cooldown lookup.-Sibling of ``agent/conversation_compression.py`` (the facade), which late-imports it at its call site;+Split from ``agent/conversation_compression.py`` (facade size cap), which imports it at module level;this module must never import the facade (import cycle). It logs under the facade's logger name so logconsumers keep one source."""