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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user