pub fn persist_window_messages(
session_dir: &Path,
messages: &[ChatMessage],
) -> Result<()>Expand description
Persist the current window’s full ChatMessage list as a JSONL snapshot.
Writes atomically (tmp → rename) so a crash mid-write never corrupts the existing file. System and ephemeral messages are skipped — the resumed session will use a fresh system prompt.