mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-30 00:58:42 +00:00
fix: skip provider wildcard metadata parsing
This commit is contained in:
@@ -106,8 +106,7 @@ function createModelManifestPluginContext(params: {
|
||||
|
||||
function listModelAliasCandidates(cfg: OpenClawConfig): ModelAliasCandidate[] {
|
||||
return Object.entries(cfg.agents?.defaults?.models ?? {}).flatMap(([keyRaw, entryRaw]) => {
|
||||
const trimmedKey = keyRaw.trim();
|
||||
if (trimmedKey.endsWith("/*") && normalizeProviderId(trimmedKey.slice(0, -2))) {
|
||||
if (parseProviderWildcardModelRef(keyRaw)) {
|
||||
return [];
|
||||
}
|
||||
const alias =
|
||||
@@ -559,7 +558,7 @@ function buildModelCatalogMetadata(
|
||||
const aliasByKey = new Map<string, string>();
|
||||
const configuredModels = params.cfg.agents?.defaults?.models ?? {};
|
||||
for (const [rawKey, entryRaw] of Object.entries(configuredModels)) {
|
||||
if (rawKey.trim().endsWith("/*")) {
|
||||
if (parseProviderWildcardModelRef(rawKey)) {
|
||||
continue;
|
||||
}
|
||||
const alias = ((entryRaw as { alias?: string } | undefined)?.alias ?? "").trim();
|
||||
@@ -1242,6 +1241,14 @@ export function normalizeModelSelection(value: unknown): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function parseProviderWildcardModelRef(raw: string): string | null {
|
||||
const trimmed = raw.trim();
|
||||
if (!trimmed.endsWith("/*")) {
|
||||
return null;
|
||||
}
|
||||
return normalizeProviderId(trimmed.slice(0, -2)) || null;
|
||||
}
|
||||
|
||||
export function parseConfiguredModelVisibilityEntries(params: { cfg?: OpenClawConfig }): {
|
||||
exactModelRefs: string[];
|
||||
providerWildcards: Set<string>;
|
||||
@@ -1256,12 +1263,10 @@ export function parseConfiguredModelVisibilityEntries(params: { cfg?: OpenClawCo
|
||||
if (!trimmed) {
|
||||
continue;
|
||||
}
|
||||
if (trimmed.endsWith("/*")) {
|
||||
const provider = normalizeProviderId(trimmed.slice(0, -2));
|
||||
if (provider) {
|
||||
providerWildcards.add(provider);
|
||||
continue;
|
||||
}
|
||||
const wildcardProvider = parseProviderWildcardModelRef(trimmed);
|
||||
if (wildcardProvider) {
|
||||
providerWildcards.add(wildcardProvider);
|
||||
continue;
|
||||
}
|
||||
exactModelRefs.push(raw);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user