惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
博客园 - 司徒正美
Last Week in AI
Last Week in AI
爱范儿
爱范儿
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
量子位
V
V2EX
博客园 - 叶小钗
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: tighten model catalog manifest validation · openclaw...
shakkernerd · 2026-04-25 · via Recent Commits to openclaw:main

@@ -696,6 +696,14 @@ function normalizeModelCatalogNumber(value: unknown): number | undefined {

696696

return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : undefined;

697697

}

698698699+

function normalizeModelCatalogPositiveNumber(value: unknown): number | undefined {

700+

return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : undefined;

701+

}

702+703+

function normalizeModelCatalogPositiveInteger(value: unknown): number | undefined {

704+

return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : undefined;

705+

}

706+699707

function normalizeModelCatalogTieredCost(

700708

value: unknown,

701709

): PluginManifestModelCatalogTieredCost[] | undefined {

@@ -756,6 +764,72 @@ function normalizeModelCatalogCost(value: unknown): PluginManifestModelCatalogCo

756764

return Object.keys(cost).length > 0 ? cost : undefined;

757765

}

758766767+

function normalizeModelCatalogCompat(value: unknown): ModelCompatConfig | undefined {

768+

if (!isRecord(value)) {

769+

return undefined;

770+

}

771+

const compat: Record<string, unknown> = {};

772+

const booleanFields = [

773+

"supportsStore",

774+

"supportsPromptCacheKey",

775+

"supportsDeveloperRole",

776+

"supportsReasoningEffort",

777+

"supportsUsageInStreaming",

778+

"supportsTools",

779+

"supportsStrictMode",

780+

"requiresStringContent",

781+

"requiresToolResultName",

782+

"requiresAssistantAfterToolResult",

783+

"requiresThinkingAsText",

784+

"nativeWebSearchTool",

785+

"requiresMistralToolIds",

786+

"requiresOpenAiAnthropicToolPayload",

787+

] as const;

788+

for (const field of booleanFields) {

789+

if (typeof value[field] === "boolean") {

790+

compat[field] = value[field];

791+

}

792+

}

793+794+

const stringFields = ["toolSchemaProfile", "toolCallArgumentsEncoding"] as const;

795+

for (const field of stringFields) {

796+

const normalized = normalizeOptionalString(value[field]) ?? "";

797+

if (normalized) {

798+

compat[field] = normalized;

799+

}

800+

}

801+802+

const stringListFields = [

803+

"visibleReasoningDetailTypes",

804+

"unsupportedToolSchemaKeywords",

805+

] as const;

806+

for (const field of stringListFields) {

807+

const normalized = normalizeTrimmedStringList(value[field]);

808+

if (normalized.length > 0) {

809+

compat[field] = normalized;

810+

}

811+

}

812+813+

const maxTokensField = normalizeOptionalString(value.maxTokensField) ?? "";

814+

if (maxTokensField === "max_completion_tokens" || maxTokensField === "max_tokens") {

815+

compat.maxTokensField = maxTokensField;

816+

}

817+818+

const thinkingFormat = normalizeOptionalString(value.thinkingFormat) ?? "";

819+

if (

820+

thinkingFormat === "openai" ||

821+

thinkingFormat === "openrouter" ||

822+

thinkingFormat === "deepseek" ||

823+

thinkingFormat === "zai" ||

824+

thinkingFormat === "qwen" ||

825+

thinkingFormat === "qwen-chat-template"

826+

) {

827+

compat.thinkingFormat = thinkingFormat;

828+

}

829+830+

return Object.keys(compat).length > 0 ? (compat as ModelCompatConfig) : undefined;

831+

}

832+759833

function normalizeModelCatalogStatus(value: unknown): PluginManifestModelCatalogStatus | undefined {

760834

const status = normalizeOptionalString(value) ?? "";

761835

return MODEL_CATALOG_STATUSES.has(status)

@@ -777,11 +851,11 @@ function normalizeModelCatalogModel(value: unknown): PluginManifestModelCatalogM

777851

const headers = normalizeStringMap(value.headers);

778852

const input = normalizeModelCatalogInputs(value.input);

779853

const reasoning = typeof value.reasoning === "boolean" ? value.reasoning : undefined;

780-

const contextWindow = normalizeModelCatalogNumber(value.contextWindow);

781-

const contextTokens = normalizeModelCatalogNumber(value.contextTokens);

782-

const maxTokens = normalizeModelCatalogNumber(value.maxTokens);

854+

const contextWindow = normalizeModelCatalogPositiveNumber(value.contextWindow);

855+

const contextTokens = normalizeModelCatalogPositiveInteger(value.contextTokens);

856+

const maxTokens = normalizeModelCatalogPositiveNumber(value.maxTokens);

783857

const cost = normalizeModelCatalogCost(value.cost);

784-

const compat = isRecord(value.compat) ? (value.compat as ModelCompatConfig) : undefined;

858+

const compat = normalizeModelCatalogCompat(value.compat);

785859

const status = normalizeModelCatalogStatus(value.status);

786860

const statusReason = normalizeOptionalString(value.statusReason) ?? "";

787861

const replaces = normalizeTrimmedStringList(value.replaces);

@@ -810,14 +884,15 @@ function normalizeModelCatalogModel(value: unknown): PluginManifestModelCatalogM

810884811885

function normalizeModelCatalogProviders(

812886

value: unknown,

887+

ownedProviders: ReadonlySet<string>,

813888

): Record<string, PluginManifestModelCatalogProvider> | undefined {

814889

if (!isRecord(value)) {

815890

return undefined;

816891

}

817892

const providers: Record<string, PluginManifestModelCatalogProvider> = {};

818893

for (const [rawProviderId, rawProvider] of Object.entries(value)) {

819894

const providerId = normalizeSafeRecordKey(rawProviderId);

820-

if (!providerId || !isRecord(rawProvider)) {

895+

if (!providerId || !ownedProviders.has(providerId) || !isRecord(rawProvider)) {

821896

continue;

822897

}

823898

const models = Array.isArray(rawProvider.models)

@@ -843,6 +918,7 @@ function normalizeModelCatalogProviders(

843918844919

function normalizeModelCatalogAliases(

845920

value: unknown,

921+

ownedProviders: ReadonlySet<string>,

846922

): Record<string, PluginManifestModelCatalogAlias> | undefined {

847923

if (!isRecord(value)) {

848924

return undefined;

@@ -854,7 +930,7 @@ function normalizeModelCatalogAliases(

854930

continue;

855931

}

856932

const provider = normalizeOptionalString(rawTarget.provider) ?? "";

857-

if (!provider) {

933+

if (!provider || !ownedProviders.has(provider)) {

858934

continue;

859935

}

860936

const api = normalizeModelCatalogApi(rawTarget.api);

@@ -896,6 +972,7 @@ function normalizeModelCatalogSuppressions(

896972897973

function normalizeModelCatalogDiscovery(

898974

value: unknown,

975+

ownedProviders: ReadonlySet<string>,

899976

): Record<string, PluginManifestModelCatalogDiscovery> | undefined {

900977

if (!isRecord(value)) {

901978

return undefined;

@@ -904,21 +981,24 @@ function normalizeModelCatalogDiscovery(

904981

for (const [rawProviderId, rawMode] of Object.entries(value)) {

905982

const providerId = normalizeSafeRecordKey(rawProviderId);

906983

const mode = normalizeOptionalString(rawMode) ?? "";

907-

if (providerId && MODEL_CATALOG_DISCOVERY_MODES.has(mode)) {

984+

if (providerId && ownedProviders.has(providerId) && MODEL_CATALOG_DISCOVERY_MODES.has(mode)) {

908985

discovery[providerId] = mode as PluginManifestModelCatalogDiscovery;

909986

}

910987

}

911988

return Object.keys(discovery).length > 0 ? discovery : undefined;

912989

}

913990914-

function normalizeManifestModelCatalog(value: unknown): PluginManifestModelCatalog | undefined {

991+

function normalizeManifestModelCatalog(

992+

value: unknown,

993+

ownedProviders: ReadonlySet<string>,

994+

): PluginManifestModelCatalog | undefined {

915995

if (!isRecord(value)) {

916996

return undefined;

917997

}

918-

const providers = normalizeModelCatalogProviders(value.providers);

919-

const aliases = normalizeModelCatalogAliases(value.aliases);

998+

const providers = normalizeModelCatalogProviders(value.providers, ownedProviders);

999+

const aliases = normalizeModelCatalogAliases(value.aliases, ownedProviders);

9201000

const suppressions = normalizeModelCatalogSuppressions(value.suppressions);

921-

const discovery = normalizeModelCatalogDiscovery(value.discovery);

1001+

const discovery = normalizeModelCatalogDiscovery(value.discovery, ownedProviders);

9221002

const modelCatalog = {

9231003

...(providers ? { providers } : {}),

9241004

...(aliases ? { aliases } : {}),

@@ -1237,7 +1317,7 @@ export function loadPluginManifest(

12371317

const providers = normalizeTrimmedStringList(raw.providers);

12381318

const providerDiscoveryEntry = normalizeOptionalString(raw.providerDiscoveryEntry);

12391319

const modelSupport = normalizeManifestModelSupport(raw.modelSupport);

1240-

const modelCatalog = normalizeManifestModelCatalog(raw.modelCatalog);

1320+

const modelCatalog = normalizeManifestModelCatalog(raw.modelCatalog, new Set(providers));

12411321

const providerEndpoints = normalizeManifestProviderEndpoints(raw.providerEndpoints);

12421322

const cliBackends = normalizeTrimmedStringList(raw.cliBackends);

12431323

const syntheticAuthRefs = normalizeTrimmedStringList(raw.syntheticAuthRefs);