Skip to content

Commit b7ff825

Browse files
committed
test: guard plugin-sdk shared-bundle regression (openclaw#45426) (thanks @TarasShyn)
1 parent ccced29 commit b7ff825

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Docs: https://docs.openclaw.ai
1313

1414
### Fixes
1515

16+
- Build/plugin-sdk bundling: bundle plugin-sdk subpath entries in one shared build pass so published packages stop duplicating shared chunks and avoid the recent plugin-sdk memory blow-up. (#45426) Thanks @TarasShyn.
1617
- Browser/existing-session: accept text-only `list_pages` and `new_page` responses from Chrome DevTools MCP so live-session tab discovery and new-tab open flows keep working when the server omits structured page metadata.
1718
- Ollama/reasoning visibility: stop promoting native `thinking` and `reasoning` fields into final assistant text so local reasoning models no longer leak internal thoughts in normal replies. (#45330) Thanks @xi7ang.
1819
- Cron/isolated sessions: route nested cron-triggered embedded runner work onto the nested lane so isolated cron jobs no longer deadlock when compaction or other queued inner work runs. Thanks @vincentkoc.

src/plugin-sdk/index.test.ts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,58 @@
1+
import fs from "node:fs/promises";
2+
import os from "node:os";
3+
import path from "node:path";
4+
import { pathToFileURL } from "node:url";
5+
import { build } from "tsdown";
16
import { describe, expect, it } from "vitest";
27
import * as sdk from "./index.js";
38

9+
const pluginSdkEntrypoints = [
10+
"index",
11+
"core",
12+
"compat",
13+
"telegram",
14+
"discord",
15+
"slack",
16+
"signal",
17+
"imessage",
18+
"whatsapp",
19+
"line",
20+
"msteams",
21+
"acpx",
22+
"bluebubbles",
23+
"copilot-proxy",
24+
"device-pair",
25+
"diagnostics-otel",
26+
"diffs",
27+
"feishu",
28+
"google-gemini-cli-auth",
29+
"googlechat",
30+
"irc",
31+
"llm-task",
32+
"lobster",
33+
"matrix",
34+
"mattermost",
35+
"memory-core",
36+
"memory-lancedb",
37+
"minimax-portal-auth",
38+
"nextcloud-talk",
39+
"nostr",
40+
"open-prose",
41+
"phone-control",
42+
"qwen-portal-auth",
43+
"synology-chat",
44+
"talk-voice",
45+
"test-utils",
46+
"thread-ownership",
47+
"tlon",
48+
"twitch",
49+
"voice-call",
50+
"zalo",
51+
"zalouser",
52+
"account-id",
53+
"keyed-async-queue",
54+
] as const;
55+
456
describe("plugin-sdk exports", () => {
557
it("does not expose runtime modules", () => {
658
const forbidden = [
@@ -104,4 +156,31 @@ describe("plugin-sdk exports", () => {
104156
expect(sdk).toHaveProperty(key);
105157
}
106158
});
159+
160+
it("emits importable bundled subpath entries", { timeout: 240_000 }, async () => {
161+
const outDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-plugin-sdk-build-"));
162+
163+
try {
164+
await build({
165+
clean: true,
166+
config: false,
167+
dts: false,
168+
entry: Object.fromEntries(
169+
pluginSdkEntrypoints.map((entry) => [entry, `src/plugin-sdk/${entry}.ts`]),
170+
),
171+
env: { NODE_ENV: "production" },
172+
fixedExtension: false,
173+
logLevel: "error",
174+
outDir,
175+
platform: "node",
176+
});
177+
178+
for (const entry of pluginSdkEntrypoints) {
179+
const module = await import(pathToFileURL(path.join(outDir, `${entry}.js`)).href);
180+
expect(module).toBeTypeOf("object");
181+
}
182+
} finally {
183+
await fs.rm(outDir, { recursive: true, force: true });
184+
}
185+
});
107186
});

0 commit comments

Comments
 (0)