#[non_exhaustive]pub enum Disposition {
Terminal,
RetryAfter,
NeedsConfig,
}Expand description
What a caller should DO about a failure, as opposed to what happened.
docs/ERRORS.md §2 has carried per-code retry guidance since Phase 0 and
it is good guidance — but it is a markdown table, and the agent making the
retry decision never reads it. Its only signal was the NAME of the code,
and several names point the wrong way: NO_OA_AVAILABLE is the most common
failure there is, and “no OA available” invites an unbounded retry loop for
something that will not change until the configuration does (#506).
Three states, not two. “Retryable / not retryable” cannot express the case that matters most here — the answer will not change by itself, but a named one-line change makes it change. Facing that, an agent should neither loop nor give up silently; it should surface the specific change to a human.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Terminal
The answer will not change. Do not retry, and do not wait for it.
Includes failures a caller can act on by issuing a DIFFERENT request
(INVALID_REF, AMBIGUOUS, TEXT_UNAVAILABLE): this call is settled,
which is what the disposition is about.
RetryAfter
The answer may change on its own. Retry, with backoff.
NeedsConfig
The answer will not change by itself, but a named change makes it. Surface it; do not loop.
Implementations§
Trait Implementations§
Source§impl Clone for Disposition
impl Clone for Disposition
Source§fn clone(&self) -> Disposition
fn clone(&self) -> Disposition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more