fix: sanitize loaded chat history
Ensure that chat history loaded from a file has resemblance of correct data. Namely title and timestamp are present and are strings, and entires, messages, and todos are lists. In case of inconsistencies replace with empty/default data. This should help with #2584. More changes are needed to sanitize individual entries.
This commit is contained in:
@@ -503,9 +503,9 @@ vim.g.avante_login = vim.g.avante_login
|
||||
---@class avante.ChatHistory
|
||||
---@field title string
|
||||
---@field timestamp string
|
||||
---@field messages avante.HistoryMessage[] | nil
|
||||
---@field entries avante.ChatHistoryEntry[] | nil
|
||||
---@field todos avante.TODO[] | nil
|
||||
---@field messages avante.HistoryMessage[]
|
||||
---@field entries avante.ChatHistoryEntry[]
|
||||
---@field todos avante.TODO[]
|
||||
---@field memory avante.ChatMemory | nil
|
||||
---@field filename string
|
||||
---@field system_prompt string | nil
|
||||
|
||||
Reference in New Issue
Block a user