pub fn claim_auto_turn(counter: &mut u32) -> boolExpand description
Centralised auto-turn claim gate.
Semantics (single source of truth):
cap == 0→ always allowed (unlimited): incrementcounter, returntrue.counter < cap→ allowed: incrementcounterand returntrue.counter >= cap→ denied: leavecounterunchanged, returnfalse.- User input resets
counterto 0 (caller responsibility — not this function).
claim_auto_turn uses the default AUTO_TURN_CAP; production callers
should use claim_auto_turn_with_cap with the configured
events.auto_turn_cap.
All paths that may fire an auto-triggered model turn (TUI event arm, TUI
stream arm, chat EventWake, chat AutoTriggerEvents, server idle wake, server
AutoTriggerEvents) must call this function and bail when it returns false
instead of duplicating the fetch_add / >= cap pattern inline.
§Arguments
counter— mutable reference to the caller’su32counter.
§Returns
true if a turn is allowed (counter was incremented), false if parked.