fix: strip leaked memory context from commentary

This commit is contained in:
dontcallmejames
2026-04-18 13:27:25 -04:00
committed by kshitij
parent dad0217450
commit 39713ba2ae
2 changed files with 25 additions and 1 deletions

View File

@@ -6051,7 +6051,7 @@ class AIAgent:
if cb is None or not isinstance(assistant_msg, dict):
return
content = assistant_msg.get("content")
visible = self._strip_think_blocks(content or "").strip()
visible = sanitize_context(self._strip_think_blocks(content or "")).strip()
if not visible or visible == "(empty)":
return
already_streamed = self._interim_content_was_streamed(visible)