mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-01 02:02:20 +00:00
fix(compact): reduce to last user question when summary_model not configured but prior compaction block exists
Aligns the summary_model_not_configured path with the under-threshold and client-compaction-block paths, which both reduce post-compaction messages to just the latest user question so the downstream provider doesn't get the summary on system prefix AND the full post-compaction history. Co-authored-by: Yassin Kortam <yassin@berri.ai>
This commit is contained in:
parent
da18d905a3
commit
b17a8c2acf
1 changed files with 5 additions and 0 deletions
|
|
@ -511,6 +511,11 @@ async def apply_compact_20260112(
|
|||
summary_model = _read_summary_model_setting()
|
||||
if summary_model is None:
|
||||
applied["error"] = "summary_model_not_configured"
|
||||
if prior_compaction_block is not None:
|
||||
# Prior context lives in ``augmented_system`` (compaction summary
|
||||
# prefix); reduce to the latest user question to avoid re-sending
|
||||
# stale post-compaction turns the summary already covers.
|
||||
downstream_messages = _select_last_user_question(effective_messages)
|
||||
return PolyfillResult(
|
||||
messages=downstream_messages,
|
||||
system=augmented_system,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue