From cce5e1fe79adb144832bc705b6fbf61d078e7c3b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 2 Nov 2026 16:34:40 +0100 Subject: [PATCH] Delete the refused record's unreachable keep-held arm Co-Authored-By: Claude Opus 5.5 --- crates/mind-body/src/persona.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/mind-body/src/persona.rs b/crates/mind-body/src/persona.rs index 8184673..2d417b1 100644 --- a/crates/mind-body/src/persona.rs +++ b/crates/mind-body/src/persona.rs @@ -1164,12 +1164,11 @@ impl SessionInbox for PersonaInbox<'_, C, S> } merged.sort_by_key(|delivery| delivery.seq); merged.dedup_by_key(|delivery| delivery.seq); - // A line in flight may hold a batch at a higher count than this result's, so the start's record only rises. + // A line in flight may hold a batch at a higher count than this result's, so the start's record only rises. A refusal always has a batch: the result that carries none is a flush alone, and a flush is written alone only when no refused batch waits, so one in flight has its own result first, whose refusal puts it back in the retell this one merges. let held = self.progress.refused.take(); self.progress.refused = merged .first() - .map(|first| Refused { lowest: held.map_or(first.seq, |held| held.lowest.min(first.seq)), why, refusals: held.map_or(most, |held| held.refusals.max(most)) }) - .or(held); + .map(|first| Refused { lowest: held.map_or(first.seq, |held| held.lowest.min(first.seq)), why, refusals: held.map_or(most, |held| held.refusals.max(most)) }); self.retell = Some(Retell { batch: merged, why, refusals: most }); Ok((true, false)) }