add length eviction if no compression

This commit is contained in:
dmahan93 2026-04-16 01:10:11 -05:00
parent d988343570
commit 721e0b96cd

View file

@ -7059,6 +7059,15 @@ class AIAgent:
finish_reason = response.choices[0].finish_reason finish_reason = response.choices[0].finish_reason
if finish_reason == "length": if finish_reason == "length":
if not self.compression_enabled:
return {
"final_response": None,
"messages": messages,
"api_calls": api_call_count,
"completed": False,
"partial": True,
"error": "Response truncated due to output length limit",
}
self._vprint(f"{self.log_prefix}⚠️ Response truncated (finish_reason='length') - model hit max output tokens", force=True) self._vprint(f"{self.log_prefix}⚠️ Response truncated (finish_reason='length') - model hit max output tokens", force=True)
# ── Detect thinking-budget exhaustion ────────────── # ── Detect thinking-budget exhaustion ──────────────