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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Y
Y Combinator Blog
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
S
SegmentFault 最新的问题
J
Java Code Geeks
V
Visual Studio Blog
H
Help Net Security
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
B
Blog RSS Feed
The Cloudflare Blog
MyScale Blog
MyScale Blog
月光博客
月光博客
Microsoft Security Blog
Microsoft Security 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(models): reuse plugin metadata snapshot (#83033) · op...
joshavant · 2026-05-17 · via Recent Commits to openclaw:main

@@ -10,6 +10,7 @@ import {

1010

loadManifestMetadataSnapshot,

1111

} from "../plugins/manifest-contract-eligibility.js";

1212

import { loadPluginMetadataSnapshot } from "../plugins/plugin-metadata-snapshot.js";

13+

import type { PluginMetadataSnapshot } from "../plugins/plugin-metadata-snapshot.types.js";

1314

import { augmentModelCatalogWithProviderPlugins } from "../plugins/provider-runtime.runtime.js";

1415

import { createLazyImportLoader } from "../shared/lazy-promise.js";

1516

import {

@@ -131,13 +132,16 @@ export function loadManifestModelCatalog(params: {

131132

workspaceDir?: string;

132133

env?: NodeJS.ProcessEnv;

133134

fallbackToMetadataScan?: boolean;

135+

metadataSnapshot?: PluginMetadataSnapshot;

134136

}): ModelCatalogEntry[] {

135-

const snapshot = getCurrentPluginMetadataSnapshot({

136-

config: params.config,

137-

env: params.env,

138-

...(params.workspaceDir !== undefined ? { workspaceDir: params.workspaceDir } : {}),

139-

...(params.workspaceDir === undefined ? { allowWorkspaceScopedSnapshot: true } : {}),

140-

});

137+

const snapshot =

138+

params.metadataSnapshot ??

139+

getCurrentPluginMetadataSnapshot({

140+

config: params.config,

141+

env: params.env,

142+

...(params.workspaceDir !== undefined ? { workspaceDir: params.workspaceDir } : {}),

143+

...(params.workspaceDir === undefined ? { allowWorkspaceScopedSnapshot: true } : {}),

144+

});

141145

const resolvedSnapshot =

142146

snapshot ??

143147

(params.fallbackToMetadataScan === false

@@ -256,6 +260,7 @@ function normalizePersistedModelCatalogEntry(

256260257261

async function loadReadOnlyPersistedModelCatalog(params?: {

258262

config?: OpenClawConfig;

263+

metadataSnapshot?: PluginMetadataSnapshot;

259264

}): Promise<ModelCatalogEntry[]> {

260265

const cfg = params?.config ?? getRuntimeConfig();

261266

const agentDir = resolveDefaultAgentDir(cfg);

@@ -266,10 +271,12 @@ async function loadReadOnlyPersistedModelCatalog(params?: {

266271

const shouldSuppressBuiltInModel = buildShouldSuppressBuiltInModel({ config: cfg });

267272

let manifestPlugins: ProviderModelIdNormalizationOptions["manifestPlugins"];

268273

const getManifestPlugins = () => {

269-

manifestPlugins ??= loadManifestMetadataSnapshot({

270-

config: cfg,

271-

env: process.env,

272-

}).plugins;

274+

manifestPlugins ??=

275+

params?.metadataSnapshot?.plugins ??

276+

loadManifestMetadataSnapshot({

277+

config: cfg,

278+

env: process.env,

279+

}).plugins;

273280

return manifestPlugins;

274281

};

275282

const providers =

@@ -327,7 +334,10 @@ function hasConfiguredProviderRowsNeedingManifestLookup(cfg: OpenClawConfig): bo

327334

);

328335

}

329336330-

function loadReadOnlyStaticModelCatalog(params?: { config?: OpenClawConfig }): ModelCatalogEntry[] {

337+

function loadReadOnlyStaticModelCatalog(params?: {

338+

config?: OpenClawConfig;

339+

metadataSnapshot?: PluginMetadataSnapshot;

340+

}): ModelCatalogEntry[] {

331341

const cfg = params?.config ?? getRuntimeConfig();

332342

const models: ModelCatalogEntry[] = [];

333343

try {

@@ -337,6 +347,7 @@ function loadReadOnlyStaticModelCatalog(params?: { config?: OpenClawConfig }): M

337347

config: cfg,

338348

env: process.env,

339349

fallbackToMetadataScan: false,

350+

metadataSnapshot: params?.metadataSnapshot,

340351

}),

341352

);

342353

} catch (error) {

@@ -347,10 +358,11 @@ function loadReadOnlyStaticModelCatalog(params?: { config?: OpenClawConfig }): M

347358

}

348359349360

const configuredManifestPlugins = hasConfiguredProviderRowsNeedingManifestLookup(cfg)

350-

? loadPluginMetadataSnapshot({

361+

? (params?.metadataSnapshot?.plugins ??

362+

loadPluginMetadataSnapshot({

351363

config: cfg,

352364

env: process.env,

353-

}).plugins

365+

}).plugins)

354366

: [];

355367

const configuredModels = buildConfiguredModelCatalog({

356368

cfg,

@@ -366,6 +378,7 @@ export async function loadModelCatalog(params?: {

366378

config?: OpenClawConfig;

367379

useCache?: boolean;

368380

readOnly?: boolean;

381+

metadataSnapshot?: PluginMetadataSnapshot;

369382

}): Promise<ModelCatalogEntry[]> {

370383

const readOnly = params?.readOnly === true;

371384

if (readOnly) {

@@ -380,7 +393,8 @@ export async function loadModelCatalog(params?: {

380393

if (!readOnly && params?.useCache === false) {

381394

modelCatalogPromise = null;

382395

}

383-

if (!readOnly && modelCatalogPromise) {

396+

const useSharedCache = !readOnly && !params?.metadataSnapshot;

397+

if (useSharedCache && modelCatalogPromise) {

384398

return modelCatalogPromise;

385399

}

386400

@@ -400,10 +414,12 @@ export async function loadModelCatalog(params?: {

400414

const cfg = params?.config ?? getRuntimeConfig();

401415

let manifestPlugins: ProviderModelIdNormalizationOptions["manifestPlugins"];

402416

const getManifestPlugins = () => {

403-

manifestPlugins ??= loadManifestMetadataSnapshot({

404-

config: cfg,

405-

env: process.env,

406-

}).plugins;

417+

manifestPlugins ??=

418+

params?.metadataSnapshot?.plugins ??

419+

loadManifestMetadataSnapshot({

420+

config: cfg,

421+

env: process.env,

422+

}).plugins;

407423

return manifestPlugins;

408424

};

409425

if (!readOnly) {

@@ -511,7 +527,7 @@ export async function loadModelCatalog(params?: {

511527512528

if (models.length === 0) {

513529

// If we found nothing, don't cache this result so we can try again.

514-

if (!readOnly) {

530+

if (useSharedCache) {

515531

modelCatalogPromise = null;

516532

}

517533

}

@@ -525,7 +541,7 @@ export async function loadModelCatalog(params?: {

525541

log.warn(`Failed to load model catalog: ${String(error)}`);

526542

}

527543

// Don't poison the cache on transient dependency/filesystem issues.

528-

if (!readOnly) {

544+

if (useSharedCache) {

529545

modelCatalogPromise = null;

530546

}

531547

if (models.length > 0) {

@@ -535,7 +551,7 @@ export async function loadModelCatalog(params?: {

535551

}

536552

};

537553538-

if (readOnly) {

554+

if (readOnly || params?.metadataSnapshot) {

539555

return loadCatalog();

540556

}

541557