Skip to main content

load_interactive_session_history_with_crumb

Function load_interactive_session_history_with_crumb 

pub fn load_interactive_session_history_with_crumb(
    path: &Path,
    system_prompt: &str,
) -> Result<(Vec<ChatMessage>, bool)>
Expand description

Load interactive history plus the persisted breadcrumb provenance. Legacy files without the flag are migrated by inspecting the restored history: if the first non-system message equals the breadcrumb string, the flag is recovered as true. v2 records carry an explicit history_has_trim_breadcrumb (true or false) so a genuine user message that collides with the breadcrumb text keeps its real turn-boundary role. Legacy v1 migration is locale-independent: it checks the canonical English breadcrumb plus the current-locale string, covering both the stable historical value and any future translated variant. A v1 file whose first user turn genuinely equals the breadcrumb text cannot be distinguished from a synthetic marker on its one-time migration; after the next persist the file becomes v2 with the (mis)classified flag, which is the documented one-time limitation for unmarked legacy state.