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

推荐订阅源

Y
Y Combinator Blog
博客园_首页
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Help Net Security
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
About on SuperTechFans
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
月光博客
月光博客
云风的 BLOG
云风的 BLOG
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
C
Check Point Blog
V
V2EX
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
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
refactor: reuse lookup table during gateway plugin load ·...
shakkernerd · 2026-04-27 · via Recent Commits to openclaw:main

@@ -1,4 +1,5 @@

11

import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";

2+

import type { PluginLookUpTable } from "../plugins/plugin-lookup-table.js";

23

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

34

import type { PluginRuntimeGatewayRequestScope } from "../plugins/runtime/gateway-request-scope.js";

45

import type { PluginRuntime } from "../plugins/runtime/types.js";

@@ -108,6 +109,47 @@ const createRegistry = (diagnostics: PluginDiagnostic[]): PluginRegistry => ({

108109

diagnostics,

109110

});

110111112+

function createLookUpTableForTest(params: {

113+

manifestRegistry?: PluginLookUpTable["manifestRegistry"];

114+

pluginIds?: readonly string[];

115+

}): PluginLookUpTable {

116+

return {

117+

key: "test",

118+

index: {

119+

version: 1,

120+

hostContractVersion: "test",

121+

compatRegistryVersion: "test",

122+

migrationVersion: 1,

123+

policyHash: "test",

124+

generatedAtMs: 1,

125+

installRecords: {},

126+

plugins: [],

127+

diagnostics: [],

128+

},

129+

registryDiagnostics: [],

130+

manifestRegistry: params.manifestRegistry ?? { plugins: [], diagnostics: [] },

131+

plugins: [],

132+

diagnostics: [],

133+

byPluginId: new Map(),

134+

normalizePluginId: (pluginId) => pluginId,

135+

owners: {

136+

channels: new Map(),

137+

channelConfigs: new Map(),

138+

providers: new Map(),

139+

modelCatalogProviders: new Map(),

140+

cliBackends: new Map(),

141+

setupProviders: new Map(),

142+

commandAliases: new Map(),

143+

contracts: new Map(),

144+

},

145+

startup: {

146+

channelPluginIds: [],

147+

configuredDeferredChannelPluginIds: [],

148+

pluginIds: params.pluginIds ?? [],

149+

},

150+

};

151+

}

152+111153

type ServerPluginsModule = typeof import("./server-plugins.js");

112154

type ServerPluginBootstrapModule = typeof import("./server-plugin-bootstrap.js");

113155

type PluginRuntimeModule = typeof import("../plugins/runtime/index.js");

@@ -372,6 +414,30 @@ describe("loadGatewayPlugins", () => {

372414

);

373415

});

374416417+

test("reuses a provided lookup table for startup scope and auto-enable manifests", async () => {

418+

loadOpenClawPlugins.mockReturnValue(createRegistry([]));

419+

const manifestRegistry = { plugins: [], diagnostics: [] };

420+421+

loadGatewayPluginsForTest({

422+

pluginLookUpTable: createLookUpTableForTest({

423+

manifestRegistry,

424+

pluginIds: ["telegram"],

425+

}),

426+

});

427+428+

expect(loadPluginLookUpTable).not.toHaveBeenCalled();

429+

expect(applyPluginAutoEnable).toHaveBeenCalledWith({

430+

config: {},

431+

env: process.env,

432+

manifestRegistry,

433+

});

434+

expect(loadOpenClawPlugins).toHaveBeenCalledWith(

435+

expect.objectContaining({

436+

onlyPluginIds: ["telegram"],

437+

}),

438+

);

439+

});

440+375441

test("pins the initial startup channel registry against later active-registry churn", async () => {

376442

const startupRegistry = createRegistry([]);

377443

loadOpenClawPlugins.mockReturnValue(startupRegistry);