if (storageLocation.log) {
if (session instanceof ChatModel) {
session.dataSerializer = new ChatSessionOperationLog();
}
let op: 'append' | 'replace';
let data: VSBuffer;
try {
({ op, data } = session.dataSerializer.write(session));
} catch (e) {
// This is a big of an ugly prompt, but there is _something_ going on with
// missing sessions. Unfortunately it's hard to root cause because users would