mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 16:10:45 +00:00
perf: use manifest catalog for agent allowlists
This commit is contained in:
@@ -51,7 +51,7 @@ import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "./defaults.js";
|
||||
import { resolveFastModeState } from "./fast-mode.js";
|
||||
import { AGENT_LANE_SUBAGENT } from "./lanes.js";
|
||||
import { LiveSessionModelSwitchError } from "./live-model-switch.js";
|
||||
import { loadModelCatalog } from "./model-catalog.js";
|
||||
import { loadManifestModelCatalog } from "./model-catalog.js";
|
||||
import { runWithModelFallback } from "./model-fallback.js";
|
||||
import {
|
||||
buildAllowedModelSet,
|
||||
@@ -729,12 +729,12 @@ async function agentCommandInternal(
|
||||
}
|
||||
const needsModelCatalog = Boolean(hasAllowlist);
|
||||
let allowedModelKeys = new Set<string>();
|
||||
let allowedModelCatalog: Awaited<ReturnType<typeof loadModelCatalog>> = [];
|
||||
let modelCatalog: Awaited<ReturnType<typeof loadModelCatalog>> | null = null;
|
||||
let allowedModelCatalog: ReturnType<typeof loadManifestModelCatalog> = [];
|
||||
let modelCatalog: ReturnType<typeof loadManifestModelCatalog> | null = null;
|
||||
let allowAnyModel = !hasAllowlist;
|
||||
|
||||
if (needsModelCatalog) {
|
||||
modelCatalog = await loadModelCatalog({ config: cfg });
|
||||
modelCatalog = loadManifestModelCatalog({ config: cfg, workspaceDir });
|
||||
const allowed = buildAllowedModelSet({
|
||||
cfg,
|
||||
catalog: modelCatalog,
|
||||
|
||||
Reference in New Issue
Block a user