Skip to main content

recovery_allowed

Function recovery_allowed 

Source
pub(crate) fn recovery_allowed(candidate: &str, head: Option<&str>) -> bool
Expand description

Whether a resume-failure recovery may continue candidate (§4.2: only the head of the chain is this conversation). With a chain, any other session is older or unrelated history. It’s typically the same agent’s session from the last time it ran under this account, and resuming it would show “Resumed” on the wrong conversation, so the caller falls through to a fresh session carrying the continuation packet. With no known head (an agent from before the segment index, whose only segment is the current one), nothing better is known and recovery works as before.