fix(history): tolerate tool-call turns during compact (#2626)

This commit is contained in:
Ocean Bennett
2026-06-04 14:59:41 -04:00
committed by GitHub
parent 24220155af
commit ca32b43b38
2 changed files with 146 additions and 1 deletions

View File

@@ -544,7 +544,7 @@ def setup_history_routes(session_manager) -> APIRouter:
# Build text to summarize
convo_text = "\n".join(
f"{(m.role if isinstance(m, ChatMessage) else m.get('role', '')).upper()}: "
f"{(m.content if isinstance(m, ChatMessage) else m.get('content', ''))[:2000]}"
f"{((m.content if isinstance(m, ChatMessage) else m.get('content')) or '')[:2000]}"
for m in older
)