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

推荐订阅源

美团技术团队
IT之家
IT之家
博客园 - Franky
博客园_首页
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed

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: start configured generation providers · openclaw/ope...
steipete · 2026-05-05 · via Recent Commits to openclaw:main

@@ -39,6 +39,11 @@ export type GatewayStartupPluginPlan = {

3939

};

40404141

type NormalizedPluginsConfig = ReturnType<typeof normalizePluginsConfigWithRegistry>;

42+

type GenerationProviderContractKey =

43+

| "imageGenerationProviders"

44+

| "videoGenerationProviders"

45+

| "musicGenerationProviders";

46+

type ConfiguredGenerationProviderIds = Record<GenerationProviderContractKey, ReadonlySet<string>>;

42474348

function isRecord(value: unknown): value is Record<string, unknown> {

4449

return Boolean(value && typeof value === "object" && !Array.isArray(value));

@@ -209,6 +214,123 @@ function manifestOwnsConfiguredSpeechProvider(params: {

209214

});

210215

}

211216217+

function listModelProviderRefs(value: unknown): string[] {

218+

if (typeof value === "string") {

219+

return [value];

220+

}

221+

if (!isRecord(value)) {

222+

return [];

223+

}

224+

const refs: string[] = [];

225+

if (typeof value.primary === "string") {

226+

refs.push(value.primary);

227+

}

228+

if (Array.isArray(value.fallbacks)) {

229+

for (const fallback of value.fallbacks) {

230+

if (typeof fallback === "string") {

231+

refs.push(fallback);

232+

}

233+

}

234+

}

235+

return refs;

236+

}

237+238+

function collectModelProviderIds(value: unknown): ReadonlySet<string> {

239+

return new Set(

240+

listModelProviderRefs(value)

241+

.map((ref) => {

242+

const slashIndex = ref.indexOf("/");

243+

return slashIndex > 0 ? normalizeOptionalLowercaseString(ref.slice(0, slashIndex)) : "";

244+

})

245+

.filter((providerId): providerId is string => Boolean(providerId)),

246+

);

247+

}

248+249+

function collectConfiguredGenerationProviderIds(

250+

config: OpenClawConfig,

251+

): ConfiguredGenerationProviderIds {

252+

const defaults = config.agents?.defaults;

253+

return {

254+

imageGenerationProviders: collectModelProviderIds(defaults?.imageGenerationModel),

255+

videoGenerationProviders: collectModelProviderIds(defaults?.videoGenerationModel),

256+

musicGenerationProviders: collectModelProviderIds(defaults?.musicGenerationModel),

257+

};

258+

}

259+260+

function manifestOwnsConfiguredGenerationProvider(params: {

261+

manifest: PluginManifestRecord | undefined;

262+

configuredGenerationProviderIds: ConfiguredGenerationProviderIds;

263+

}): boolean {

264+

for (const contractKey of [

265+

"imageGenerationProviders",

266+

"videoGenerationProviders",

267+

"musicGenerationProviders",

268+

] as const) {

269+

const configuredProviderIds = params.configuredGenerationProviderIds[contractKey];

270+

if (configuredProviderIds.size === 0) {

271+

continue;

272+

}

273+

if (

274+

(params.manifest?.contracts?.[contractKey] ?? []).some((providerId) => {

275+

const normalized = normalizeOptionalLowercaseString(providerId);

276+

return normalized ? configuredProviderIds.has(normalized) : false;

277+

})

278+

) {

279+

return true;

280+

}

281+

}

282+

return false;

283+

}

284+285+

function canStartConfiguredGenerationProviderPlugin(params: {

286+

plugin: InstalledPluginIndexRecord;

287+

manifest: PluginManifestRecord | undefined;

288+

config: OpenClawConfig;

289+

pluginsConfig: ReturnType<typeof normalizePluginsConfigWithRegistry>;

290+

activationSource: {

291+

plugins: ReturnType<typeof normalizePluginsConfigWithRegistry>;

292+

rootConfig?: OpenClawConfig;

293+

};

294+

configuredGenerationProviderIds: ConfiguredGenerationProviderIds;

295+

platform?: NodeJS.Platform;

296+

}): boolean {

297+

if (

298+

!manifestOwnsConfiguredGenerationProvider({

299+

manifest: params.manifest,

300+

configuredGenerationProviderIds: params.configuredGenerationProviderIds,

301+

})

302+

) {

303+

return false;

304+

}

305+

if (!params.pluginsConfig.enabled || !params.activationSource.plugins.enabled) {

306+

return false;

307+

}

308+

if (

309+

params.pluginsConfig.deny.includes(params.plugin.pluginId) ||

310+

params.activationSource.plugins.deny.includes(params.plugin.pluginId)

311+

) {

312+

return false;

313+

}

314+

if (

315+

params.pluginsConfig.entries[params.plugin.pluginId]?.enabled === false ||

316+

params.activationSource.plugins.entries[params.plugin.pluginId]?.enabled === false

317+

) {

318+

return false;

319+

}

320+

const activationState = resolveEffectivePluginActivationState({

321+

id: params.plugin.pluginId,

322+

origin: params.plugin.origin,

323+

config: params.pluginsConfig,

324+

rootConfig: params.config,

325+

enabledByDefault: isPluginEnabledByDefaultForPlatform(params.plugin, params.platform),

326+

activationSource: params.activationSource,

327+

});

328+

return (

329+

activationState.enabled &&

330+

(params.plugin.origin === "bundled" || activationState.explicitlyEnabled)

331+

);

332+

}

333+212334

function canStartConfiguredSpeechProviderPlugin(params: {

213335

plugin: InstalledPluginIndexRecord;

214336

manifest: PluginManifestRecord | undefined;

@@ -512,6 +634,8 @@ export function resolveGatewayStartupPluginPlanFromRegistry(params: {

512634

const startupDreamingPluginIds = resolveGatewayStartupDreamingPluginIds(params.config);

513635

const manifestLookup = createManifestRegistryLookup(params.manifestRegistry);

514636

const configuredSpeechProviderIds = collectConfiguredSpeechProviderIds(activationSourceConfig);

637+

const configuredGenerationProviderIds =

638+

collectConfiguredGenerationProviderIds(activationSourceConfig);

515639

const normalizePluginId = createPluginRegistryIdNormalizer(params.index, {

516640

manifestRegistry: params.manifestRegistry,

517641

});

@@ -581,6 +705,19 @@ export function resolveGatewayStartupPluginPlanFromRegistry(params: {

581705

) {

582706

return true;

583707

}

708+

if (

709+

canStartConfiguredGenerationProviderPlugin({

710+

plugin,

711+

manifest,

712+

config: params.config,

713+

pluginsConfig,

714+

activationSource,

715+

configuredGenerationProviderIds,

716+

platform: params.platform,

717+

})

718+

) {

719+

return true;

720+

}

584721

if (

585722

canStartExplicitHookPlugin({

586723

plugin,