persist threadId as a metadata field for arlearn_msg object