mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 09:45:24 -04:00
fix(context_compactor): return original messages when compaction summary fails (#2174)
On summary LLM call failure, maybe_compact was returning system_msgs+recent (dropping the older half) with was_compacted=False, misleading the caller into thinking the list was unchanged. Return the original messages list unchanged so no history is lost; the next trim_for_context call handles length if needed. Fixes #2160 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -381,7 +381,10 @@ async def maybe_compact(
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Compaction summary failed: {e}")
|
||||
return system_msgs + recent, context_length, False
|
||||
# Degrade gracefully: keep the conversation intact rather than
|
||||
# silently dropping the older half. was_compacted=False signals the
|
||||
# caller nothing was summarized; trim_for_context handles length.
|
||||
return messages, context_length, False
|
||||
|
||||
summary_msg = {
|
||||
"role": "system",
|
||||
|
||||
Reference in New Issue
Block a user