openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
14 lines (13 loc) • 951 B
JavaScript
//#region src/agents/embedded-agent-runner/run/auth-profile-failure-policy.ts
/**
* Returns the subset of failover reasons that should affect shared auth-profile
* health. Local helper failures and request-shape/transport outcomes stay
* session-local so one bad transcript or connection does not cool down an
* otherwise healthy provider profile.
*/
function resolveAuthProfileFailureReason(e) {
if (e.policy === "local" || !e.failoverReason || e.failoverReason === "overloaded" || e.policy === "local_transient" && e.failoverReason === "rate_limit" && e.transientRateLimit === true || e.failoverReason === "server_error" || e.failoverReason === "tls_certificate" || e.failoverReason === "empty_response" || e.failoverReason === "context_overflow" || e.failoverReason === "format" || e.failoverReason === "timeout" && e.providerStarted !== true) return null;
return e.failoverReason;
}
//#endregion
export { resolveAuthProfileFailureReason as t };