replaceHistory method
Replaces native session history with messages.
Implementation
@override
Future<void> replaceHistory(List<OmnixMessage> messages) {
if (_closed) throw StateError('Agent session is closed.');
if (_running) throw StateError('An agent turn is already in progress.');
return _session.chat.clearHistory(
replayHistory: messages.map(mapOmnixMessage).toList(growable: false),
);
}