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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Cloudflare Blog
U
Unit 42
D
Docker
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
Recent Announcements
Recent Announcements
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
V
Visual Studio Blog
I
InfoQ
Google DeepMind News
Google DeepMind News
小众软件
小众软件
L
LangChain Blog
C
Check Point Blog
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
J
Java Code Geeks
罗磊的独立博客

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: use plugin lookup table for gateway load fallba...
shakkernerd · 2026-04-27 · via Recent Commits to openclaw:main

@@ -6,7 +6,13 @@ import type { PluginDiagnostic } from "../plugins/types.js";

66

import type { GatewayRequestContext, GatewayRequestOptions } from "./server-methods/types.js";

7788

const loadOpenClawPlugins = vi.hoisted(() => vi.fn());

9-

const resolveGatewayStartupPluginIds = vi.hoisted(() => vi.fn(() => ["discord", "telegram"]));

9+

const loadPluginLookUpTable = vi.hoisted(() =>

10+

vi.fn(() => ({

11+

startup: {

12+

pluginIds: ["discord", "telegram"],

13+

},

14+

})),

15+

);

1016

const applyPluginAutoEnable = vi.hoisted(() =>

1117

vi.fn(({ config }) => ({ config, changes: [], autoEnabledReasons: {} })),

1218

);

@@ -34,8 +40,8 @@ vi.mock("../plugins/runtime/load-context.js", () => ({

3440

createPluginRuntimeLoaderLogger: () => pluginRuntimeLoaderLogger,

3541

}));

364237-

vi.mock("../plugins/channel-plugin-ids.js", () => ({

38-

resolveGatewayStartupPluginIds,

43+

vi.mock("../plugins/plugin-lookup-table.js", () => ({

44+

loadPluginLookUpTable,

3945

}));

40464147

vi.mock("../config/plugin-auto-enable.js", () => ({

@@ -243,7 +249,11 @@ beforeAll(async () => {

243249244250

beforeEach(() => {

245251

loadOpenClawPlugins.mockReset();

246-

resolveGatewayStartupPluginIds.mockReset().mockReturnValue(["discord", "telegram"]);

252+

loadPluginLookUpTable.mockReset().mockReturnValue({

253+

startup: {

254+

pluginIds: ["discord", "telegram"],

255+

},

256+

});

247257

applyPluginAutoEnable

248258

.mockReset()

249259

.mockImplementation(({ config }) => ({ config, changes: [], autoEnabledReasons: {} }));

@@ -306,7 +316,7 @@ describe("loadGatewayPlugins", () => {

306316

config: {},

307317

env: process.env,

308318

});

309-

expect(resolveGatewayStartupPluginIds).toHaveBeenCalledWith({

319+

expect(loadPluginLookUpTable).toHaveBeenCalledWith({

310320

config: {},

311321

activationSourceConfig: undefined,

312322

workspaceDir: "/tmp",

@@ -354,7 +364,7 @@ describe("loadGatewayPlugins", () => {

354364

pluginIds: ["browser"],

355365

});

356366357-

expect(resolveGatewayStartupPluginIds).not.toHaveBeenCalled();

367+

expect(loadPluginLookUpTable).not.toHaveBeenCalled();

358368

expect(loadOpenClawPlugins).toHaveBeenCalledWith(

359369

expect.objectContaining({

360370

onlyPluginIds: ["browser"],

@@ -397,7 +407,7 @@ describe("loadGatewayPlugins", () => {

397407

pluginIds: ["slack"],

398408

});

399409400-

expect(resolveGatewayStartupPluginIds).not.toHaveBeenCalled();

410+

expect(loadPluginLookUpTable).not.toHaveBeenCalled();

401411

expect(applyPluginAutoEnable).toHaveBeenCalledWith({

402412

config: rawConfig,

403413

env: process.env,

@@ -415,7 +425,11 @@ describe("loadGatewayPlugins", () => {

415425

});

416426417427

test("treats an empty startup scope as no plugin load instead of an unscoped load", async () => {

418-

resolveGatewayStartupPluginIds.mockReturnValue([]);

428+

loadPluginLookUpTable.mockReturnValue({

429+

startup: {

430+

pluginIds: [],

431+

},

432+

});

419433420434

const result = serverPluginsModule.loadGatewayPlugins({

421435

cfg: {},

@@ -431,7 +445,11 @@ describe("loadGatewayPlugins", () => {

431445

});

432446433447

test("stores workspaceDir on the active registry when startup scope is empty", () => {

434-

resolveGatewayStartupPluginIds.mockReturnValue([]);

448+

loadPluginLookUpTable.mockReturnValue({

449+

startup: {

450+

pluginIds: [],

451+

},

452+

});

435453436454

serverPluginsModule.loadGatewayPlugins({

437455

cfg: {},

@@ -457,7 +475,7 @@ describe("loadGatewayPlugins", () => {

457475458476

loadGatewayPluginsForTest();

459477460-

expect(resolveGatewayStartupPluginIds).toHaveBeenCalledWith({

478+

expect(loadPluginLookUpTable).toHaveBeenCalledWith({

461479

config: autoEnabledConfig,

462480

activationSourceConfig: undefined,

463481

workspaceDir: "/tmp",

@@ -495,7 +513,7 @@ describe("loadGatewayPlugins", () => {

495513

config: rawConfig,

496514

env: process.env,

497515

});

498-

expect(resolveGatewayStartupPluginIds).toHaveBeenCalledWith({

516+

expect(loadPluginLookUpTable).toHaveBeenCalledWith({

499517

config: resolvedConfig,

500518

activationSourceConfig: rawConfig,

501519

workspaceDir: "/tmp",

@@ -979,7 +997,7 @@ describe("loadGatewayPlugins", () => {

979997

logDiagnostics: false,

980998

});

981999982-

expect(resolveGatewayStartupPluginIds).not.toHaveBeenCalled();

1000+

expect(loadPluginLookUpTable).not.toHaveBeenCalled();

9831001

expect(loadOpenClawPlugins).toHaveBeenCalledWith(

9841002

expect.objectContaining({

9851003

onlyPluginIds: ["discord"],