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

推荐订阅源

GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
A
About on SuperTechFans
Y
Y Combinator Blog
D
DataBreaches.Net
I
InfoQ
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
G
Google Developers Blog
博客园_首页
博客园 - 司徒正美
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
博客园 - 叶小钗
Engineering at Meta
Engineering at Meta
Apple Machine Learning Research
Apple Machine Learning Research
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
D
Docker
量子位

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): force dependency installs local · openclaw/...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -387,4 +387,72 @@ describe("installPackageDir", () => {

387387

listMatchingEntries(targetDir, ".openclaw-install-hidden-npmrc-"),

388388

).resolves.toHaveLength(0);

389389

});

390+391+

it("forces dependency installs to stay project-local when npm global config leaks in", async () => {

392+

await fixtureRootTracker.setup();

393+

const fixtureRoot = await fixtureRootTracker.make("case");

394+

const sourceDir = path.join(fixtureRoot, "source");

395+

const targetDir = path.join(fixtureRoot, "plugins", "demo");

396+

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

397+

await fs.writeFile(

398+

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

399+

JSON.stringify({

400+

name: "demo-plugin",

401+

version: "1.0.0",

402+

dependencies: {

403+

zod: "^4.0.0",

404+

},

405+

}),

406+

"utf-8",

407+

);

408+409+

vi.stubEnv("NPM_CONFIG_GLOBAL", "true");

410+

vi.stubEnv("npm_config_global", "true");

411+

vi.stubEnv("NPM_CONFIG_LOCATION", "global");

412+

vi.stubEnv("npm_config_location", "global");

413+

vi.stubEnv("NPM_CONFIG_PREFIX", path.join(fixtureRoot, "global-prefix-uppercase"));

414+

vi.stubEnv("npm_config_prefix", path.join(fixtureRoot, "global-prefix"));

415+

vi.mocked(runCommandWithTimeout).mockResolvedValue({

416+

stdout: "",

417+

stderr: "",

418+

code: 0,

419+

signal: null,

420+

killed: false,

421+

termination: "exit",

422+

});

423+424+

const result = await installPackageDir({

425+

sourceDir,

426+

targetDir,

427+

mode: "install",

428+

timeoutMs: 1_000,

429+

copyErrorPrefix: "failed to copy plugin",

430+

hasDeps: true,

431+

depsLogMessage: "Installing deps…",

432+

});

433+434+

expect(result).toEqual({ ok: true });

435+

expect(vi.mocked(runCommandWithTimeout)).toHaveBeenCalledWith(

436+

["npm", "install", "--omit=dev", "--silent", "--ignore-scripts"],

437+

expect.objectContaining({

438+

env: expect.objectContaining({

439+

npm_config_global: "false",

440+

npm_config_location: "project",

441+

npm_config_package_lock: "false",

442+

npm_config_save: "false",

443+

}),

444+

}),

445+

);

446+

expect(vi.mocked(runCommandWithTimeout)).toHaveBeenCalledWith(

447+

expect.any(Array),

448+

expect.objectContaining({

449+

env: expect.not.objectContaining({

450+

NPM_CONFIG_GLOBAL: expect.any(String),

451+

NPM_CONFIG_LOCATION: expect.any(String),

452+

NPM_CONFIG_PREFIX: expect.any(String),

453+

npm_config_prefix: expect.any(String),

454+

}),

455+

}),

456+

);

457+

});

390458

});