refactor(agent): pack import lists (AST-identical)

This commit is contained in:
Teknium
2026-09-02 19:12:17 -07:00
parent 7c76e5f219
commit 21274c8523
2 changed files with 4 additions and 17 deletions

View File

@@ -299,14 +299,9 @@ def _maybe_apply_moa_cache_control(
Returns the messages unchanged on any error.
"""
try:
from agent.agent_runtime_helpers import (
anthropic_prompt_cache_policy,
blank_cache_policy_stub,
)
from agent.agent_runtime_helpers import anthropic_prompt_cache_policy, blank_cache_policy_stub
from agent.prompt_caching import (
apply_anthropic_cache_control,
effective_cache_ttl,
envelope_tool_part_cache_markers_supported,
apply_anthropic_cache_control, effective_cache_ttl, envelope_tool_part_cache_markers_supported,
)
# Explicit kwarg > runtime snapshot (threaded from the live agent) > config.
@@ -436,10 +431,7 @@ def _trim_messages_for_reference(
if not messages:
return messages
from agent.model_metadata import (
estimate_messages_tokens_rough,
get_model_context_length,
)
from agent.model_metadata import estimate_messages_tokens_rough, get_model_context_length
model = str(slot.get("model") or "")
provider = str(runtime.get("provider") or slot.get("provider") or "")

View File

@@ -16,12 +16,7 @@ import time
from typing import Any, Mapping, Optional
from utils import atomic_write_text
from agent.rate_limit_tracker import (
_BUCKET_TAGS,
_fmt_seconds,
_safe_float,
_safe_int,
has_rate_limit_headers,
lower_headers,
_BUCKET_TAGS, _fmt_seconds, _safe_float, _safe_int, has_rate_limit_headers, lower_headers,
)
logger = logging.getLogger(__name__)