pub enum FallbackReason {
CredentialRejected,
CredentialAbsent,
RateLimited,
QuotaExhausted,
TimedOut,
Failed,
}Expand description
Why the chain moved past a candidate.
Coarse on purpose. The point is to distinguish causes an operator would ACT
on differently — sign in, wait, configure a key, look at the provider — not
to reproduce every provider’s error taxonomy. Anything unrecognized is
FallbackReason::Failed rather than being forced into a bucket it does
not belong in.
Variants§
CredentialRejected
A credential exists and was REFUSED — an expired Parslee session, or a
provider rejecting an API key (ProviderAccount 401/403).
Deliberately broader than InferenceResult::auth_fallback_from’s
predicate, which names only the subset a person clears by signing in.
car auth login does not fix a bad OpenAI key, so this variant must not
be read as “run that” — the remedy depends on which credential was
refused.
CredentialAbsent
No credential is configured for that lane at all. A different fix from
CredentialRejected: nothing expired, nothing was ever set.
RateLimited
The provider rate-limited the call (429 / “too many requests”). Clears by waiting.
QuotaExhausted
The account is out of credits or over quota (402).
Separate from FallbackReason::RateLimited because an empty balance
does NOT clear by waiting — the remedy is to top up. Folding it in told
an operator to wait out a billing problem.
TimedOut
The call exceeded its deadline.
Only when a deadline is what was actually hit. A transport failure with
no status — connection refused, DNS, TLS, a truncated body — is
FallbackReason::Failed, because telling someone their call timed out
when the endpoint was never up sends them to raise a timeout instead of
starting the runtime.
Failed
Anything else — a 5xx, a malformed request, a panicked runner, an
unreadable credential store. The honest bucket, and it has to STAY
honest: a first version of this classifier matched substrings and
silently absorbed every ProviderAccount rejection here, which is the
opposite of what this variant is for.
Trait Implementations§
Source§impl Clone for FallbackReason
impl Clone for FallbackReason
impl Copy for FallbackReason
Source§impl Debug for FallbackReason
impl Debug for FallbackReason
Source§impl<'de> Deserialize<'de> for FallbackReason
impl<'de> Deserialize<'de> for FallbackReason
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>,
impl Eq for FallbackReason
Source§impl JsonSchema for FallbackReason
impl JsonSchema for FallbackReason
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for FallbackReason
impl PartialEq for FallbackReason
Source§impl Serialize for FallbackReason
impl Serialize for FallbackReason
impl StructuralPartialEq for FallbackReason
Auto Trait Implementations§
impl Freeze for FallbackReason
impl RefUnwindSafe for FallbackReason
impl Send for FallbackReason
impl Sync for FallbackReason
impl Unpin for FallbackReason
impl UnsafeUnpin for FallbackReason
impl UnwindSafe for FallbackReason
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more