- Enhanced the conversion of message history to agent format by distinguishing between normal and rich agent messages. - Implemented logic to preserve full message structure for tool-related messages, ensuring valid assistant-to-tool sequences. - Simplified handling of simple text messages by stripping unnecessary fields while retaining essential role and content information.