openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
37 lines (36 loc) • 1.42 kB
JavaScript
import { i as DEFAULT_PROVIDER, n as DEFAULT_MODEL } from "./defaults-BWyoTPqn.mjs";
import { t as splitTrailingAuthProfile } from "./model-ref-profile-C7DWqVP0.mjs";
import { a as resolveAgentEffectiveModelPrimary } from "./agent-scope-BwB8YH6y.mjs";
import { h as resolveConfiguredModelRef } from "./model-selection-shared-9Kz63Hhm.mjs";
import { t as resolveAllowedModelRefCore } from "./model-selection-resolve-CyMfPqoi.mjs";
import { o as resolveLegacyHeartbeatConfig } from "./doctor-heartbeat-legacy-DmzlheVU.mjs";
//#region src/commands/doctor-heartbeat-model.ts
/** Heartbeat's former turn-local selector cannot grant ordinary automation model access. */
function resolveHeartbeatAutomationModel(e, t) {
const n = resolveLegacyHeartbeatConfig(e, t)?.model;
if (!n) return {};
const r = resolveConfiguredModelRef({
cfg: e,
agentId: t,
defaultProvider: DEFAULT_PROVIDER,
defaultModel: DEFAULT_MODEL
});
const i = resolveAllowedModelRefCore({
cfg: e,
agentId: t,
catalog: [],
defaultProvider: r.provider,
defaultModel: r,
raw: n
});
if ("error" in i && i.error.startsWith("model not allowed:")) {
const i = splitTrailingAuthProfile(resolveAgentEffectiveModelPrimary(e, t) ?? "").profile;
return { fallback: {
model: n,
defaultModel: `${r.provider}/${r.model}${i ? `@${i}` : ""}`
} };
}
return { model: n };
}
//#endregion
export { resolveHeartbeatAutomationModel as t };