fix(compression): avoid repeat preflight compaction from rough estimates

This commit is contained in:
helix4u
2026-05-29 19:05:03 -07:00
committed by Teknium
parent 04de307d62
commit e38b0b55d1
6 changed files with 193 additions and 14 deletions
+9
View File
@@ -115,6 +115,15 @@ class ContextEngine(ABC):
"""
return False
def should_defer_preflight_to_real_usage(self, rough_tokens: int) -> bool:
"""Return True when preflight should trust recent real usage instead.
Built-in compression uses this to avoid re-compacting from known-noisy
rough estimates after a compressed request has already fit. Third-party
engines can ignore it safely.
"""
return False
# -- Optional: manual /compress preflight ------------------------------
def has_content_to_compress(self, messages: List[Dict[str, Any]]) -> bool: