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

推荐订阅源

IT之家
IT之家
A
About on SuperTechFans
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
博客园 - Franky
D
Docker
Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
Last Week in AI
Last Week in AI
U
Unit 42
F
Fortinet All Blogs
H
Help Net Security
Blog — PlanetScale
Blog — PlanetScale
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
P
Proofpoint News Feed
月光博客
月光博客
G
Google Developers 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
fix(plugins): simplify bundled runtime deps staging · ope...
steipete · 2026-04-30 · via Recent Commits to openclaw:main

@@ -1,6 +1,7 @@

11

import fs from "node:fs";

22

import os from "node:os";

33

import path from "node:path";

4+

import { pathToFileURL } from "node:url";

45

import { importFreshModule } from "openclaw/plugin-sdk/test-fixtures";

56

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

67

import { loadPluginManifestRegistry } from "../../plugins/manifest-registry.js";

@@ -651,6 +652,102 @@ describe("bundled channel entry shape guards", () => {

651652

}

652653

});

653654655+

it("does not load bundled runtime entries through external staged runtime deps during discovery", async () => {

656+

const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-bundled-runtime-deps-"));

657+

const stageRoot = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-bundled-stage-"));

658+

const previousBundledPluginsDir = process.env.OPENCLAW_BUNDLED_PLUGINS_DIR;

659+

const previousPluginStageDir = process.env.OPENCLAW_PLUGIN_STAGE_DIR;

660+

const pluginDir = path.join(root, "dist", "extensions", "alpha");

661+

const testGlobal = globalThis as typeof globalThis & {

662+

__bundledRuntimeDepMarker?: string;

663+

};

664+

fs.mkdirSync(pluginDir, { recursive: true });

665+

fs.writeFileSync(

666+

path.join(root, "package.json"),

667+

JSON.stringify({ name: "openclaw", version: "2026.4.21" }),

668+

"utf8",

669+

);

670+

fs.writeFileSync(

671+

path.join(pluginDir, "package.json"),

672+

JSON.stringify({

673+

name: "@openclaw/alpha",

674+

version: "2026.4.21",

675+

type: "module",

676+

dependencies: {

677+

"alpha-runtime-dep": "1.0.0",

678+

},

679+

}),

680+

"utf8",

681+

);

682+

fs.writeFileSync(

683+

path.join(pluginDir, "plugin.js"),

684+

[

685+

"import { marker } from 'alpha-runtime-dep';",

686+

"globalThis.__bundledRuntimeDepMarker = marker;",

687+

"export default { id: 'alpha', meta: { label: marker }, config: {} };",

688+

"",

689+

].join("\n"),

690+

"utf8",

691+

);

692+

fs.writeFileSync(

693+

path.join(pluginDir, "index.js"),

694+

[

695+

`import { defineBundledChannelEntry } from ${JSON.stringify(pathToFileURL(path.resolve("src/plugin-sdk/channel-entry-contract.ts")).href)};`,

696+

"export default defineBundledChannelEntry({",

697+

" id: 'alpha',",

698+

" name: 'Alpha',",

699+

" description: 'Alpha',",

700+

" importMetaUrl: import.meta.url,",

701+

" plugin: { specifier: './plugin.js' },",

702+

"});",

703+

"",

704+

].join("\n"),

705+

"utf8",

706+

);

707+708+

process.env.OPENCLAW_PLUGIN_STAGE_DIR = stageRoot;

709+

const { resolveBundledRuntimeDependencyInstallRoot } =

710+

await import("../../plugins/bundled-runtime-deps.js");

711+

const installRoot = resolveBundledRuntimeDependencyInstallRoot(pluginDir);

712+

const depRoot = path.join(installRoot, "node_modules", "alpha-runtime-dep");

713+

fs.mkdirSync(depRoot, { recursive: true });

714+

fs.writeFileSync(

715+

path.join(depRoot, "package.json"),

716+

JSON.stringify({

717+

name: "alpha-runtime-dep",

718+

version: "1.0.0",

719+

type: "module",

720+

main: "index.js",

721+

}),

722+

"utf8",

723+

);

724+

fs.writeFileSync(path.join(depRoot, "index.js"), "export const marker = 'staged-alpha';\n");

725+726+

mockAlphaDistExtensionRuntime();

727+728+

try {

729+

process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = path.join(root, "dist", "extensions");

730+731+

const bundled = await importFreshModule<typeof import("./bundled.js")>(

732+

import.meta.url,

733+

"./bundled.js?scope=bundled-runtime-deps",

734+

);

735+736+

expect(bundled.getBundledChannelPlugin("alpha")).toBeUndefined();

737+

expect(testGlobal.__bundledRuntimeDepMarker).toBeUndefined();

738+

} finally {

739+

restoreBundledPluginsDir(previousBundledPluginsDir);

740+

if (previousPluginStageDir === undefined) {

741+

delete process.env.OPENCLAW_PLUGIN_STAGE_DIR;

742+

} else {

743+

process.env.OPENCLAW_PLUGIN_STAGE_DIR = previousPluginStageDir;

744+

}

745+

fs.rmSync(root, { recursive: true, force: true });

746+

fs.rmSync(stageRoot, { recursive: true, force: true });

747+

delete testGlobal.__bundledRuntimeDepMarker;

748+

}

749+

});

750+654751

it("swallows and caches bundled plugin and setup load failures", async () => {

655752

const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-bundled-load-failure-"));

656753

const previousBundledPluginsDir = process.env.OPENCLAW_BUNDLED_PLUGINS_DIR;