fix: minor change in upsert logic for prompt default (#9729)

minor compaction upsert change
This commit is contained in:
amysguan
2026-03-02 11:11:48 -08:00
committed by Caren Thomas
parent c28ba77354
commit 8e60b73eee
3 changed files with 16 additions and 4 deletions

View File

@@ -712,7 +712,11 @@ async def compact_conversation(
# If mode changed from agent's original settings and prompt not explicitly set in request, then use the default prompt for the new mode
# Ex: previously was sliding_window, now is all, so we need to use the default prompt for all mode
if "mode" in changed_fields and agent.compaction_settings.mode != request.compaction_settings.mode:
if (
"mode" in changed_fields
and "prompt" not in changed_fields
and agent.compaction_settings.mode != request.compaction_settings.mode
):
from letta.services.summarizer.summarizer_config import get_default_prompt_for_mode
compaction_settings.prompt = get_default_prompt_for_mode(compaction_settings.mode)