UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

27 lines (26 loc) • 1.32 kB
//#region src/agents/live-model-switch-error.ts var LiveSessionModelSwitchError = class extends Error { constructor(e) { super(`Live session model switch requested: ${e.provider}/${e.model}`); this.name = "LiveSessionModelSwitchError"; this.provider = e.provider; this.model = e.model; this.agentRuntimeOverride = e.agentRuntimeOverride; this.authProfileId = e.authProfileId; this.authProfileIdSource = e.authProfileIdSource; } }; //#endregion //#region src/agents/failover-policy.ts function shouldAllowCooldownProbeForReason(e) { return e === "billing" || shouldUseTransientCooldownProbeSlot(e); } function shouldUseTransientCooldownProbeSlot(e) { return e === "rate_limit" || e === "overloaded" || e === "unknown" || e === "empty_response" || e === "no_error_details" || e === "unclassified" || e === "timeout"; } /** Returns true when a non-transient failure should leave transient probe budget intact. */ function shouldPreserveTransientCooldownProbeSlot(e) { return e === "model_not_found" || e === "format" || e === "auth" || e === "auth_permanent" || e === "session_expired" || e === "tls_certificate"; } //#endregion export { LiveSessionModelSwitchError as i, shouldPreserveTransientCooldownProbeSlot as n, shouldUseTransientCooldownProbeSlot as r, shouldAllowCooldownProbeForReason as t };