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

推荐订阅源

D
Docker
I
InfoQ
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
Y
Y Combinator Blog
博客园_首页
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
C
Check Point Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Engineering at Meta
Engineering at Meta
B
Blog
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学
F
Fortinet All Blogs
月光博客
月光博客
GbyAI
GbyAI

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
perf(tests): split plugin state runtime imports · opencla...
steipete · 2026-04-30 · via Recent Commits to openclaw:main

@@ -1,9 +1,6 @@

11

import { mkdirSync, statSync } from "node:fs";

22

import { afterEach, describe, expect, it, vi } from "vitest";

33

import { requireNodeSqlite } from "../infra/node-sqlite.js";

4-

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

5-

import { createPluginRegistry } from "../plugins/registry.js";

6-

import { createPluginRuntime } from "../plugins/runtime/index.js";

74

import { withOpenClawTestState } from "../test-utils/openclaw-test-state.js";

85

import {

96

closePluginStateSqliteStore,

@@ -16,42 +13,6 @@ import {

1613

} from "./plugin-state-store.js";

1714

import { resolvePluginStateDir, resolvePluginStateSqlitePath } from "./plugin-state-store.paths.js";

181519-

function createPluginRecord(id: string, origin: PluginRecord["origin"] = "bundled"): PluginRecord {

20-

return {

21-

id,

22-

name: id,

23-

source: `/plugins/${id}/index.ts`,

24-

origin,

25-

enabled: true,

26-

status: "loaded",

27-

toolNames: [],

28-

hookNames: [],

29-

channelIds: [],

30-

cliBackendIds: [],

31-

providerIds: [],

32-

speechProviderIds: [],

33-

realtimeTranscriptionProviderIds: [],

34-

realtimeVoiceProviderIds: [],

35-

mediaUnderstandingProviderIds: [],

36-

imageGenerationProviderIds: [],

37-

videoGenerationProviderIds: [],

38-

musicGenerationProviderIds: [],

39-

webFetchProviderIds: [],

40-

webSearchProviderIds: [],

41-

migrationProviderIds: [],

42-

memoryEmbeddingProviderIds: [],

43-

agentHarnessIds: [],

44-

gatewayMethods: [],

45-

cliCommands: [],

46-

services: [],

47-

gatewayDiscoveryServiceIds: [],

48-

commands: [],

49-

httpRoutes: 0,

50-

hookCount: 0,

51-

configSchema: false,

52-

} as PluginRecord;

53-

}

54-5516

afterEach(() => {

5617

vi.useRealTimers();

5718

resetPluginStateStoreForTests();

@@ -332,48 +293,3 @@ describe("plugin state keyed store", () => {

332293

});

333294

});

334295

});

335-336-

describe("plugin runtime state proxy", () => {

337-

it("binds openKeyedStore to the bundled plugin id and keeps resolveStateDir", async () => {

338-

await withOpenClawTestState({ label: "plugin-state-runtime" }, async (state) => {

339-

const registry = createPluginRegistry({

340-

logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() },

341-

runtime: createPluginRuntime(),

342-

});

343-

const record = createPluginRecord("discord", "bundled");

344-

registry.registry.plugins.push(record);

345-

const api = registry.createApi(record, { config: {} });

346-347-

expect(api.runtime.state.resolveStateDir()).toBe(state.stateDir);

348-

const store = api.runtime.state.openKeyedStore<{ plugin: string }>({

349-

namespace: "runtime",

350-

maxEntries: 10,

351-

});

352-

await store.register("k", { plugin: "discord" });

353-354-

const telegram = createPluginRecord("telegram", "bundled");

355-

registry.registry.plugins.push(telegram);

356-

const telegramApi = registry.createApi(telegram, { config: {} });

357-

const telegramStore = telegramApi.runtime.state.openKeyedStore<{ plugin: string }>({

358-

namespace: "runtime",

359-

maxEntries: 10,

360-

});

361-

await expect(telegramStore.lookup("k")).resolves.toBeUndefined();

362-

await expect(store.lookup("k")).resolves.toEqual({ plugin: "discord" });

363-

});

364-

});

365-366-

it("rejects external plugins in this release", () => {

367-

const registry = createPluginRegistry({

368-

logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() },

369-

runtime: createPluginRuntime(),

370-

});

371-

const record = createPluginRecord("external-plugin", "workspace");

372-

registry.registry.plugins.push(record);

373-

const api = registry.createApi(record, { config: {} });

374-375-

expect(() =>

376-

api.runtime.state.openKeyedStore({ namespace: "runtime", maxEntries: 10 }),

377-

).toThrow("openKeyedStore is only available for bundled plugins");

378-

});

379-

});