4eabb595f0
Follow-ups on top of the salvaged #80696 fix (review findings): - Sibling sites: rollback.restore, gateway /retry, CLI /retry and /undo N, and both CLI resume turn counters now use is_user_originated_turn so legacy-persisted standalone handoffs (durable role=user, no display_kind) can never be truncation targets or counted as user turns (#80622 suggested regression 4, dispatcher-wide). - Site-1 guard: hoist the api_call_count decrement + iteration-budget refund above the break so a skipped turn no longer leaks a budget unit and finalize_turn logs the true call count (matches the ollama early-exit and the site-2 sibling). - Site-2 guard: run the handoff guard BEFORE reanchoring so a restored user ask is what the anchor lands on, not a stale pre-restore index. - SUMMARY_PREFIX: add the mid-tool-loop carve-out the code-side guard already implements, so a literal-minded model doesn't halt an in-flight exchange after in-place compaction. - Skip path returns a short compaction status instead of replaying the previous turn's answer (finalize_turn would append it as a fresh assistant row — duplicate prose in transcript and delivery).