fix: repair flush sentinel test — mock auxiliary client and add guard

The TestFlushSentinelNotLeaked test from PR #227 had two issues:
1. flush_memories() uses get_text_auxiliary_client() which could bypass
   agent.client entirely — mock it to return (None, None)
2. No assertion that the API was actually called — added guard assert

Without these fixes the test passed vacuously (API never called).
This commit is contained in:
teknium1 2026-03-02 03:21:08 -08:00
commit c4ea996612
2 changed files with 42 additions and 0 deletions

View file

@ -2273,6 +2273,7 @@ class AIAgent:
api_msg["reasoning_content"] = reasoning
api_msg.pop("reasoning", None)
api_msg.pop("finish_reason", None)
api_msg.pop("_flush_sentinel", None)
api_messages.append(api_msg)
if self._cached_system_prompt: