

























11/** Implementation of `openclaw models status`. */
22import path from "node:path";
3+import { findNormalizedProviderValue } from "@openclaw/model-catalog-core/provider-id";
34import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
45import { colorize, theme } from "../../../packages/terminal-core/src/theme.js";
56import {
@@ -572,21 +573,6 @@ export async function modelsStatusCommand(
572573};
573574const resolveProviderAuthHealthId = (provider: string): string =>
574575resolveProviderIdForAuth(provider, envLookupParams);
575-const resolveStatusAuthOrder = (
576-order: Record<string, string[]> | undefined,
577-provider: string,
578-): string[] | undefined => {
579-if (!order) {
580-return undefined;
581-}
582-const providerKey = normalizeProviderId(provider);
583-for (const [key, value] of Object.entries(order)) {
584-if (normalizeProviderId(key) === providerKey) {
585-return value;
586-}
587-}
588-return undefined;
589-};
590576const listRuntimeAuthProviderCandidates = (
591577provider: string,
592578options?: { includeLegacyOpenAICodex?: boolean },
@@ -613,10 +599,10 @@ export async function modelsStatusCommand(
613599const providerKey = normalizeProviderId(provider);
614600const providerAuthKey = resolveProviderAuthHealthId(providerKey);
615601const explicitOrder =
616-resolveStatusAuthOrder(store.order, providerAuthKey) ??
617-resolveStatusAuthOrder(store.order, providerKey) ??
618-resolveStatusAuthOrder(cfg.auth?.order, providerAuthKey) ??
619-resolveStatusAuthOrder(cfg.auth?.order, providerKey);
602+findNormalizedProviderValue(store.order, providerAuthKey) ??
603+findNormalizedProviderValue(store.order, providerKey) ??
604+findNormalizedProviderValue(cfg.auth?.order, providerAuthKey) ??
605+findNormalizedProviderValue(cfg.auth?.order, providerKey);
620606const isEligibleOrHealthRescued = (profileId: string): boolean => {
621607const credential = store.profiles[profileId];
622608if (!credential) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。