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

推荐订阅源

P
Proofpoint News Feed
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
量子位
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
IT之家
IT之家
V
Visual Studio Blog
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
D
Docker
V
V2EX

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: preserve owned plugin dependencies during peer repai...
shakkernerd · 2026-05-13 · via Recent Commits to openclaw:main

@@ -444,7 +444,7 @@ describe("installPluginFromNpmSpec e2e", () => {

444444

).resolves.toBeTruthy();

445445

});

446446447-

it("does not attribute repaired pre-existing peer dependencies to later installs", async () => {

447+

it("scans repaired pre-existing peer dependencies during later installs", async () => {

448448

const rootDir = await makeTempDir("npm-plugin-repaired-peer-scan-e2e");

449449

const npmRoot = path.join(rootDir, "managed-npm");

450450

const pluginWithRuntimePeer = `existing-peer-plugin-${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}`;

@@ -531,13 +531,27 @@ describe("installPluginFromNpmSpec e2e", () => {

531531

logger: { info: () => {}, warn: () => {} },

532532

timeoutMs: 120_000,

533533

});

534-

if (!later.ok) {

535-

throw new Error(later.error);

534+

expect(later.ok).toBe(false);

535+

if (later.ok) {

536+

throw new Error("expected repaired peer dependency scan to block installation");

536537

}

538+

expect(later.error).toContain("Dynamic code execution detected");

537539540+

await expect(

541+

fs.lstat(path.join(npmRoot, "node_modules", laterPlugin, "package.json")),

542+

).rejects.toHaveProperty("code", "ENOENT");

538543

await expect(

539544

fs.lstat(path.join(npmRoot, "node_modules", runtimePeer, "package.json")),

540-

).resolves.toBeTruthy();

545+

).rejects.toHaveProperty("code", "ENOENT");

546+

const rootManifest = JSON.parse(

547+

await fs.readFile(path.join(npmRoot, "package.json"), "utf8"),

548+

) as {

549+

dependencies?: Record<string, string>;

550+

openclaw?: { managedPeerDependencies?: string[] };

551+

};

552+

expect(rootManifest.dependencies?.[laterPlugin]).toBeUndefined();

553+

expect(rootManifest.dependencies?.[runtimePeer]).toBeUndefined();

554+

expect(rootManifest.openclaw?.managedPeerDependencies ?? []).not.toContain(runtimePeer);

541555

});

542556543557

it("bounds peer dependency discovery across repeated nested package realpaths", async () => {

@@ -680,6 +694,119 @@ describe("installPluginFromNpmSpec e2e", () => {

680694

).rejects.toHaveProperty("code", "ENOENT");

681695

});

682696697+

it("does not take ownership of an existing root dependency observed as a peer", async () => {

698+

const rootDir = await makeTempDir("npm-plugin-peer-existing-root-e2e");

699+

const npmRoot = path.join(rootDir, "managed-npm");

700+

const existingRootDependency = `existing-root-${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}`;

701+

const blockedPlugin = `blocked-plugin-${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}`;

702+

const runtimePeer = `runtime-peer-${crypto.randomUUID().replace(/-/g, "").slice(0, 12)}`;

703+

const registry = await startStaticRegistry([

704+

{

705+

packageName: existingRootDependency,

706+

latest: "1.0.0",

707+

versions: [

708+

await packPlugin({

709+

packageName: existingRootDependency,

710+

pluginId: existingRootDependency,

711+

version: "1.0.0",

712+

rootDir,

713+

}),

714+

],

715+

},

716+

{

717+

packageName: blockedPlugin,

718+

latest: "1.0.0",

719+

versions: [

720+

await packPlugin({

721+

packageName: blockedPlugin,

722+

peerDependencies: {

723+

[existingRootDependency]: "^1.0.0",

724+

[runtimePeer]: "^1.0.0",

725+

},

726+

peerDependenciesMeta: {},

727+

pluginId: blockedPlugin,

728+

version: "1.0.0",

729+

rootDir,

730+

}),

731+

],

732+

},

733+

{

734+

packageName: runtimePeer,

735+

latest: "1.0.0",

736+

versions: [

737+

await packPlugin({

738+

indexJs: "eval('1');\n",

739+

packageName: runtimePeer,

740+

pluginId: runtimePeer,

741+

version: "1.0.0",

742+

rootDir,

743+

}),

744+

],

745+

},

746+

]);

747+

process.env.NPM_CONFIG_REGISTRY = registry;

748+

process.env.npm_config_registry = registry;

749+750+

await fs.mkdir(npmRoot, { recursive: true });

751+

await fs.writeFile(

752+

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

753+

`${JSON.stringify(

754+

{

755+

private: true,

756+

dependencies: { [existingRootDependency]: "1.0.0" },

757+

},

758+

null,

759+

2,

760+

)}\n`,

761+

"utf8",

762+

);

763+

await execFileAsync(

764+

"npm",

765+

[

766+

"install",

767+

"--omit=dev",

768+

"--omit=peer",

769+

"--legacy-peer-deps",

770+

"--loglevel=error",

771+

"--ignore-scripts",

772+

"--no-audit",

773+

"--no-fund",

774+

],

775+

{ cwd: npmRoot },

776+

);

777+778+

const result = await installPluginFromNpmSpec({

779+

spec: `${blockedPlugin}@1.0.0`,

780+

npmDir: npmRoot,

781+

logger: { info: () => {}, warn: () => {} },

782+

timeoutMs: 120_000,

783+

});

784+785+

expect(result.ok).toBe(false);

786+

const rootManifest = JSON.parse(

787+

await fs.readFile(path.join(npmRoot, "package.json"), "utf8"),

788+

) as {

789+

dependencies?: Record<string, string>;

790+

openclaw?: { managedPeerDependencies?: string[] };

791+

};

792+

expect(rootManifest.dependencies?.[existingRootDependency]).toBe("1.0.0");

793+

expect(rootManifest.dependencies?.[blockedPlugin]).toBeUndefined();

794+

expect(rootManifest.dependencies?.[runtimePeer]).toBeUndefined();

795+

expect(rootManifest.openclaw?.managedPeerDependencies ?? []).not.toContain(

796+

existingRootDependency,

797+

);

798+

expect(rootManifest.openclaw?.managedPeerDependencies ?? []).not.toContain(runtimePeer);

799+

await expect(

800+

fs.lstat(path.join(npmRoot, "node_modules", existingRootDependency, "package.json")),

801+

).resolves.toBeTruthy();

802+

await expect(

803+

fs.lstat(path.join(npmRoot, "node_modules", blockedPlugin, "package.json")),

804+

).rejects.toHaveProperty("code", "ENOENT");

805+

await expect(

806+

fs.lstat(path.join(npmRoot, "node_modules", runtimePeer, "package.json")),

807+

).rejects.toHaveProperty("code", "ENOENT");

808+

});

809+683810

it("scrubs host peers when installing beside an existing host-peer plugin", async () => {

684811

const rootDir = await makeTempDir("npm-plugin-sibling-peer-e2e");

685812

const npmRoot = path.join(rootDir, "managed-npm");