openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
16 lines (15 loc) • 858 B
JavaScript
import { l as normalizeOptionalString } from "./string-coerce-CIXf7egm.js";
import { t as areRuntimeModelRefsEquivalent } from "./model-runtime-aliases-BJ2qM8I_.js";
//#region src/status/fallback-notice-state.ts
function resolveActiveFallbackState(params) {
const selected = normalizeOptionalString(params.state?.fallbackNotice?.selectedModel);
const active = normalizeOptionalString(params.state?.fallbackNotice?.activeModel);
const reason = normalizeOptionalString(params.state?.fallbackNotice?.reason);
const fallbackActive = selected === params.selectedModelRef && active === params.activeModelRef && !areRuntimeModelRefsEquivalent(params.selectedModelRef, params.activeModelRef, { config: params.config });
return {
active: fallbackActive,
reason: fallbackActive ? reason : void 0
};
}
//#endregion
export { resolveActiveFallbackState as t };