88
// eslint-disable-next-line @typescript-eslint/no-explicit-any
89
private migrateHistoryEntry(entry: any): IChatModelInputState {
91
>
if (entry.inputText !== undefined) {
92
>
return entry as IChatModelInputState;
93
>
}
94
95
// Otherwise, it's an old IChatHistoryEntry with 'text' and 'state' properties
96
const oldEntry = entry as IChatHistoryEntry;
97
const oldState = oldEntry.state ?? {};
99
>
// Migrate chatMode to the new mode structure
100
>
let modeId: string;
101
>
let modeKind: ChatModeKind | undefined;
102
>
if (oldState.chatMode) {
103
if (typeof oldState.chatMode === 'string') {
104
modeId = oldState.chatMode;