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

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
爱范儿
爱范儿
量子位
Martin Fowler
Martin Fowler
V
V2EX
博客园 - 三生石上(FineUI控件)
I
InfoQ
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
Engineering at Meta
Engineering at Meta

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(tools): defer media generation provider discovery · o...
obviyus · 2026-05-01 · via Recent Commits to openclaw:main

@@ -4,7 +4,11 @@ import {

44

withBundledPluginEnablementCompat,

55

withBundledPluginVitestCompat,

66

} from "./bundled-compat.js";

7-

import { resolveRuntimePluginRegistry, type PluginLoadOptions } from "./loader.js";

7+

import {

8+

resolvePluginRegistryLoadCacheKey,

9+

resolveRuntimePluginRegistry,

10+

type PluginLoadOptions,

11+

} from "./loader.js";

812

import { loadPluginManifestRegistryForPluginRegistry } from "./plugin-registry.js";

913

import type { PluginRegistry } from "./registry-types.js";

1014

@@ -30,6 +34,12 @@ type CapabilityContractKey =

30343135

type CapabilityProviderForKey<K extends CapabilityProviderRegistryKey> =

3236

PluginRegistry[K][number] extends { provider: infer T } ? T : never;

37+

type CapabilityProviderEntries = PluginRegistry[CapabilityProviderRegistryKey];

38+39+

const capabilityProviderSnapshotCache = new WeakMap<

40+

OpenClawConfig,

41+

Map<string, CapabilityProviderEntries>

42+

>();

33433444

const CAPABILITY_CONTRACT_KEY: Record<CapabilityProviderRegistryKey, CapabilityContractKey> = {

3545

memoryEmbeddingProviders: "memoryEmbeddingProviders",

@@ -64,6 +74,25 @@ function resolveBundledCapabilityCompatPluginIds(params: {

6474

.toSorted((left, right) => left.localeCompare(right));

6575

}

667677+

export function resolveBundledCapabilityProviderIds(params: {

78+

key: CapabilityProviderRegistryKey;

79+

cfg?: OpenClawConfig;

80+

}): string[] {

81+

const env = process.env;

82+

const contractKey = CAPABILITY_CONTRACT_KEY[params.key];

83+

return [

84+

...new Set(

85+

loadPluginManifestRegistryForPluginRegistry({

86+

config: params.cfg,

87+

env,

88+

includeDisabled: true,

89+

}).plugins.flatMap((plugin) =>

90+

plugin.origin === "bundled" ? (plugin.contracts?.[contractKey] ?? []) : [],

91+

),

92+

),

93+

].toSorted((left, right) => left.localeCompare(right));

94+

}

95+6796

function resolveCapabilityProviderConfig(params: {

6897

key: CapabilityProviderRegistryKey;

6998

cfg?: OpenClawConfig;

@@ -101,6 +130,30 @@ function createCapabilityProviderFallbackLoadOptions(params: {

101130

return loadOptions;

102131

}

103132133+

function resolveCapabilityProviderSnapshotCache(

134+

cfg: OpenClawConfig | undefined,

135+

): Map<string, CapabilityProviderEntries> | undefined {

136+

if (!cfg) {

137+

return undefined;

138+

}

139+

let cache = capabilityProviderSnapshotCache.get(cfg);

140+

if (!cache) {

141+

cache = new Map();

142+

capabilityProviderSnapshotCache.set(cfg, cache);

143+

}

144+

return cache;

145+

}

146+147+

function resolveCapabilityProviderSnapshotCacheKey(params: {

148+

key: CapabilityProviderRegistryKey;

149+

loadOptions: PluginLoadOptions;

150+

}): string {

151+

return JSON.stringify({

152+

key: params.key,

153+

load: resolvePluginRegistryLoadCacheKey(params.loadOptions),

154+

});

155+

}

156+104157

function findProviderById<K extends CapabilityProviderRegistryKey>(

105158

entries: PluginRegistry[K],

106159

providerId: string,

@@ -246,8 +299,17 @@ export function resolvePluginCapabilityProvider<K extends CapabilityProviderRegi

246299

pluginIds,

247300

installBundledRuntimeDeps: params.installBundledRuntimeDeps,

248301

});

249-

const registry = resolveRuntimePluginRegistry(loadOptions);

250-

return findProviderById(registry?.[params.key] ?? [], params.providerId);

302+

const cache = resolveCapabilityProviderSnapshotCache(params.cfg);

303+

const cacheKey = cache

304+

? resolveCapabilityProviderSnapshotCacheKey({ key: params.key, loadOptions })

305+

: "";

306+

let loadedProviders = cache?.get(cacheKey) as PluginRegistry[K] | undefined;

307+

if (!loadedProviders) {

308+

const registry = resolveRuntimePluginRegistry(loadOptions);

309+

loadedProviders = registry?.[params.key] ?? [];

310+

cache?.set(cacheKey, loadedProviders as CapabilityProviderEntries);

311+

}

312+

return findProviderById(loadedProviders, params.providerId);

251313

}

252314253315

export function resolvePluginCapabilityProviders<K extends CapabilityProviderRegistryKey>(params: {

@@ -291,8 +353,16 @@ export function resolvePluginCapabilityProviders<K extends CapabilityProviderReg

291353

pluginIds,

292354

installBundledRuntimeDeps: params.installBundledRuntimeDeps,

293355

});

294-

const registry = resolveRuntimePluginRegistry(loadOptions);

295-

const loadedProviders = registry?.[params.key] ?? [];

356+

const cache = resolveCapabilityProviderSnapshotCache(params.cfg);

357+

const cacheKey = cache

358+

? resolveCapabilityProviderSnapshotCacheKey({ key: params.key, loadOptions })

359+

: "";

360+

let loadedProviders = cache?.get(cacheKey) as PluginRegistry[K] | undefined;

361+

if (!loadedProviders) {

362+

const registry = resolveRuntimePluginRegistry(loadOptions);

363+

loadedProviders = registry?.[params.key] ?? [];

364+

cache?.set(cacheKey, loadedProviders as CapabilityProviderEntries);

365+

}

296366

if (params.key !== "memoryEmbeddingProviders") {

297367

const mergeLoadedProviders =

298368

activeProviders.length > 0