pub enum LoopGuardMode {
Off,
Note,
Refuse,
}Expand description
What the loop guard does with a request whose replayed history trips it.
Replaces the boolean proxy_loop_detection,
which could only say “scan” or “do not scan” and made the scan’s only
answer a terminal HTTP 400. ADR 0011 records that 400 ending a Copilot
session on its sixth turn: an external agentic client has no recovery path
from a refusal, and because it replays the whole conversation every turn,
the refusal repeats for the rest of the session.
Variants§
Off
Do not scan at all.
The escape hatch for a client that legitimately repeats identical
tool-call batches with nothing in between, or repeats a response. What
proxy_loop_detection = Some(false) meant, and still means.
Note
Forward the request, with a note appended to the last message saying what repeated and how often.
The default. The model is told what gglib can see and is left to act on it, which is the one thing a refusal cannot offer a client that has no recovery path. The cost is that a genuinely runaway client now spends a generation per stuck turn instead of being stopped at threshold + 1 — the trade #1052 asks for.
Refuse
Refuse the request with HTTP 400, before any catalog, admission or model-swap cost.
What the guard did by default until #1052. Still the right answer for an operator who would rather a stuck session fail loudly than burn a shared GPU.
Implementations§
Trait Implementations§
Source§impl Clone for LoopGuardMode
impl Clone for LoopGuardMode
Source§fn clone(&self) -> LoopGuardMode
fn clone(&self) -> LoopGuardMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoopGuardMode
impl Debug for LoopGuardMode
Source§impl Default for LoopGuardMode
impl Default for LoopGuardMode
Source§fn default() -> LoopGuardMode
fn default() -> LoopGuardMode
Source§impl<'de> Deserialize<'de> for LoopGuardMode
impl<'de> Deserialize<'de> for LoopGuardMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for LoopGuardMode
impl Hash for LoopGuardMode
Source§impl PartialEq for LoopGuardMode
impl PartialEq for LoopGuardMode
Source§fn eq(&self, other: &LoopGuardMode) -> bool
fn eq(&self, other: &LoopGuardMode) -> bool
self and other values to be equal, and is used by ==.