pub fn load_session_messages(session_dir: &Path) -> Result<Vec<ChatMessage>>Expand description
Load a previously-persisted messages.jsonl and sanitize for resume.
Sanitization:
- Skip empty lines and malformed JSON (logged + skipped, not fatal).
- Drop any
Systemmessages (the resumed session uses a fresh system prompt). - Strip
reasoning_content/thinking_signaturefrom Assistant messages. - Patch dangling tool calls at the tail: if the last Assistant message has
tool_callsthat were never answered, synthesize aToolresponse with content"interrupted"so thatvalidate_message_sequencepasses.