diff --git a/src/agents/extensions/memory/advanced_sqlite_session.py b/src/agents/extensions/memory/advanced_sqlite_session.py index fefb73026..0e88176de 100644 --- a/src/agents/extensions/memory/advanced_sqlite_session.py +++ b/src/agents/extensions/memory/advanced_sqlite_session.py @@ -815,7 +815,7 @@ def _copy_sync(): ms.tool_name FROM message_structure ms WHERE ms.session_id = ? AND ms.branch_id = ? - AND ms.branch_turn_number < ? + AND ms.branch_turn_number <= ? ORDER BY ms.sequence_number """, (self.session_id, self._current_branch_id, from_turn_number),