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

推荐订阅源

WordPress大学
WordPress大学
H
Help Net Security
Jina AI
Jina AI
V
V2EX
G
Google Developers Blog
B
Blog
GbyAI
GbyAI
U
Unit 42
爱范儿
爱范儿
腾讯CDC
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
小众软件
小众软件
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
博客园 - 聂微东
The Cloudflare Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - 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
test: tighten optional plugin tool assertions · openclaw/...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -373,6 +373,17 @@ function expectLoaderCall(overrides: Record<string, unknown>) {

373373

expect(loadOpenClawPluginsMock).not.toHaveBeenCalled();

374374

}

375375376+

function mockCallParams(

377+

mock: { mock: { calls: unknown[][] } },

378+

index = 0,

379+

): Record<string, unknown> {

380+

const call = mock.mock.calls[index];

381+

if (!call) {

382+

throw new Error(`expected mock call ${index}`);

383+

}

384+

return call[0] as Record<string, unknown>;

385+

}

386+376387

function expectLoaderSelectedOnlyPluginIds(expectedPluginIds: readonly string[]) {

377388

const selectedPluginIds = loadOpenClawPluginsMock.mock.calls.map(

378389

([params]) => (params as { onlyPluginIds?: string[] }).onlyPluginIds,

@@ -628,14 +639,16 @@ describe("resolvePluginTools optional tools", () => {

628639

);

629640630641

expectResolvedToolNames(tools, ["other_tool", "optional_tool"]);

631-

expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(

632-

expect.objectContaining({

633-

activate: false,

634-

cache: false,

635-

onlyPluginIds: ["multi", "optional-demo"],

636-

toolDiscovery: true,

637-

}),

638-

);

642+

const loaderParams = mockCallParams(loadOpenClawPluginsMock) as {

643+

activate?: unknown;

644+

cache?: unknown;

645+

onlyPluginIds?: unknown;

646+

toolDiscovery?: unknown;

647+

};

648+

expect(loaderParams.activate).toBe(false);

649+

expect(loaderParams.cache).toBe(false);

650+

expect(loaderParams.onlyPluginIds).toEqual(["multi", "optional-demo"]);

651+

expect(loaderParams.toolDiscovery).toBe(true);

639652

});

640653641654

it("warns when cold registry load still does not provide the selected plugin tools", () => {

@@ -1254,9 +1267,9 @@ describe("resolvePluginTools optional tools", () => {

12541267

);

12551268

const { loadManifestContractSnapshot } = await import("./manifest-contract-eligibility.js");

12561269

const snapshot = loadManifestContractSnapshot({ config, workspaceDir: "/tmp" });

1257-

expect(

1258-

snapshot.plugins.find((plugin) => plugin.id === "multi")?.toolMetadata?.optional_tool,

1259-

).toMatchObject({ optional: true });

1270+

const optionalToolMetadata = snapshot.plugins.find((plugin) => plugin.id === "multi")

1271+

?.toolMetadata?.optional_tool;

1272+

expect(optionalToolMetadata?.optional).toBe(true);

1260127312611274

const tools = resolvePluginTools(

12621275

createResolveToolsParams({

@@ -1859,17 +1872,13 @@ describe("resolvePluginTools optional tools", () => {

18591872

] as const)("$name", ({ expectedToolNames }) => {

18601873

const { rawContext, autoEnabledConfig, tools } = resolveAutoEnabledOptionalDemoTools();

186118741862-

expect(applyPluginAutoEnableMock).toHaveBeenCalledWith(

1863-

expect.objectContaining({

1864-

config: expect.objectContaining({

1865-

plugins: expect.objectContaining({

1866-

allow: rawContext.config.plugins?.allow,

1867-

load: rawContext.config.plugins?.load,

1868-

}),

1869-

}),

1870-

env: process.env,

1871-

}),

1872-

);

1875+

const autoEnableParams = mockCallParams(applyPluginAutoEnableMock) as {

1876+

config?: { plugins?: { allow?: unknown; load?: unknown } };

1877+

env?: unknown;

1878+

};

1879+

expect(autoEnableParams.config?.plugins?.allow).toEqual(rawContext.config.plugins?.allow);

1880+

expect(autoEnableParams.config?.plugins?.load).toEqual(rawContext.config.plugins?.load);

1881+

expect(autoEnableParams.env).toBe(process.env);

18731882

if (expectedToolNames) {

18741883

expectResolvedToolNames(tools, expectedToolNames);

18751884

}

@@ -2157,13 +2166,14 @@ describe("resolvePluginTools optional tools", () => {

2157216621582167

expectResolvedToolNames(tools, ["memory_search", "memory_get"]);

21592168

expect(memorySearchFactory).toHaveBeenCalledTimes(1);

2160-

expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(

2161-

expect.objectContaining({

2162-

activate: false,

2163-

onlyPluginIds: ["memory-core"],

2164-

toolDiscovery: true,

2165-

}),

2166-

);

2169+

const loaderParams = mockCallParams(loadOpenClawPluginsMock) as {

2170+

activate?: unknown;

2171+

onlyPluginIds?: unknown;

2172+

toolDiscovery?: unknown;

2173+

};

2174+

expect(loaderParams.activate).toBe(false);

2175+

expect(loaderParams.onlyPluginIds).toEqual(["memory-core"]);

2176+

expect(loaderParams.toolDiscovery).toBe(true);

21672177

});

2168217821692179

it("adds enabled non-startup tool plugins to the active tool runtime scope", () => {

@@ -2216,18 +2226,18 @@ describe("resolvePluginTools optional tools", () => {

22162226

toolAllowlist: ["*", "tavily"],

22172227

allowGatewaySubagentBinding: true,

22182228

});

2219-

expect(resolveRuntimePluginRegistryMock).toHaveBeenCalledWith(

2220-

expect.objectContaining({

2221-

onlyPluginIds: expect.arrayContaining(["tavily"]),

2222-

toolDiscovery: true,

2223-

}),

2224-

);

2225-

expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(

2226-

expect.objectContaining({

2227-

onlyPluginIds: expect.arrayContaining(["tavily"]),

2228-

toolDiscovery: true,

2229-

}),

2230-

);

2229+

const runtimeRegistryParams = mockCallParams(resolveRuntimePluginRegistryMock) as {

2230+

onlyPluginIds?: string[];

2231+

toolDiscovery?: unknown;

2232+

};

2233+

expect(runtimeRegistryParams.onlyPluginIds).toContain("tavily");

2234+

expect(runtimeRegistryParams.toolDiscovery).toBe(true);

2235+

const loaderParams = mockCallParams(loadOpenClawPluginsMock) as {

2236+

onlyPluginIds?: string[];

2237+

toolDiscovery?: unknown;

2238+

};

2239+

expect(loaderParams.onlyPluginIds).toContain("tavily");

2240+

expect(loaderParams.toolDiscovery).toBe(true);

22312241

});

2232224222332243

it("reuses the pinned gateway channel registry after provider runtime loads replace active registry", () => {