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

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
P
Proofpoint News Feed
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
美团技术团队
D
Docker
博客园 - Franky
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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 source plugin loading fallbacks · openclaw/...
steipete · 2026-05-06 · via Recent Commits to openclaw:main

@@ -15,21 +15,19 @@ async function loadCachedPluginModuleLoader(scope: string) {

1515

options,

1616

}),

1717

);

18-

vi.doMock("jiti", () => ({

19-

createJiti,

20-

}));

211822-

const { getCachedPluginModuleLoader } = await importFreshModule<

19+

const pluginModuleLoaderCache = await importFreshModule<

2320

typeof import("./plugin-module-loader-cache.js")

2421

>(import.meta.url, `./plugin-module-loader-cache.js?scope=${scope}`);

25-26-

const getCachedPluginModuleLoaderWithMock: typeof getCachedPluginModuleLoader = (params) =>

27-

getCachedPluginModuleLoader({

22+

const getCachedPluginModuleLoader: typeof pluginModuleLoaderCache.getCachedPluginModuleLoader = (

23+

params,

24+

) =>

25+

pluginModuleLoaderCache.getCachedPluginModuleLoader({

2826

...params,

2927

createLoader: params.createLoader ?? asPluginModuleLoaderFactory(createJiti),

3028

});

312932-

return { createJiti, getCachedPluginModuleLoader: getCachedPluginModuleLoaderWithMock };

30+

return { createJiti, getCachedPluginModuleLoader };

3331

}

34323533

function asPluginModuleLoaderFactory(factory: unknown): PluginModuleLoaderFactory {

@@ -372,8 +370,6 @@ describe("getCachedPluginModuleLoader", () => {

372370

it("serves compiled .js targets from native require without invoking the module loader", async () => {

373371

const fromSourceTransformer = vi.fn();

374372

const createJiti = vi.fn(() => fromSourceTransformer);

375-

const jitiModuleFactory = vi.fn(() => ({ createJiti }));

376-

vi.doMock("jiti", jitiModuleFactory);

377373

const nativeStub = vi.fn((target: string) => ({

378374

ok: true as const,

379375

moduleExport: { loadedFrom: target },

@@ -400,13 +396,17 @@ describe("getCachedPluginModuleLoader", () => {

400396

expect(result.loadedFrom).toBe("/repo/dist/extensions/demo/api.js");

401397

// Jiti should not be constructed or invoked for .js targets that

402398

// `tryNativeRequireJavaScriptModule` resolves.

403-

expect(jitiModuleFactory).not.toHaveBeenCalled();

404399

expect(createJiti).not.toHaveBeenCalled();

405400

expect(fromSourceTransformer).not.toHaveBeenCalled();

406401

// allowWindows must be passed so the native fast path works on Windows too.

407-

expect(nativeStub).toHaveBeenCalledWith("/repo/dist/extensions/demo/api.js", {

408-

allowWindows: true,

409-

});

402+

expect(nativeStub).toHaveBeenCalledWith(

403+

"/repo/dist/extensions/demo/api.js",

404+

expect.objectContaining({

405+

allowWindows: true,

406+

fallbackOnMissingDependency: true,

407+

fallbackOnNativeError: true,

408+

}),

409+

);

410410

expect(getPluginModuleLoaderStats()).toMatchObject({

411411

calls: 1,

412412

nativeHits: 1,

@@ -446,9 +446,14 @@ describe("getCachedPluginModuleLoader", () => {

446446

expect(() => loader("/repo/dist/extensions/demo/api.js")).toThrow("missing-dep");

447447

expect(createJiti).not.toHaveBeenCalled();

448448

expect(fromSourceTransformer).not.toHaveBeenCalled();

449-

expect(nativeStub).toHaveBeenCalledWith("/repo/dist/extensions/demo/api.js", {

450-

allowWindows: true,

451-

});

449+

expect(nativeStub).toHaveBeenCalledWith(

450+

"/repo/dist/extensions/demo/api.js",

451+

expect.objectContaining({

452+

allowWindows: true,

453+

fallbackOnMissingDependency: true,

454+

fallbackOnNativeError: true,

455+

}),

456+

);

452457

expect(getPluginModuleLoaderStats()).toMatchObject({

453458

calls: 1,

454459

nativeHits: 0,

@@ -461,7 +466,6 @@ describe("getCachedPluginModuleLoader", () => {

461466

it("falls back to source transform when the native-require helper declines", async () => {

462467

const fromSourceTransformer = vi.fn(() => ({ fromSourceTransform: true }));

463468

const createJiti = vi.fn(() => fromSourceTransformer);

464-

vi.doMock("jiti", () => ({ createJiti }));

465469

vi.doMock("./native-module-require.js", () => ({

466470

isJavaScriptModulePath: () => true,

467471

tryNativeRequireJavaScriptModule: () => ({ ok: false }),

@@ -481,6 +485,10 @@ describe("getCachedPluginModuleLoader", () => {

481485482486

const result = loader("/repo/dist/extensions/demo/api.js") as { fromSourceTransform: boolean };

483487

expect(result.fromSourceTransform).toBe(true);

488+

expect(createJiti).toHaveBeenCalledWith(

489+

"file:///repo/src/plugins/public-surface-loader.ts",

490+

expect.objectContaining({ tryNative: true }),

491+

);

484492

expect(fromSourceTransformer).toHaveBeenCalledWith("/repo/dist/extensions/demo/api.js");

485493

expect(getPluginModuleLoaderStats()).toMatchObject({

486494

calls: 1,

@@ -496,7 +504,6 @@ describe("getCachedPluginModuleLoader", () => {

496504

vi.spyOn(process, "platform", "get").mockReturnValue("win32");

497505

const fromSourceTransformer = vi.fn(() => ({ fromSourceTransform: true }));

498506

const createJiti = vi.fn(() => fromSourceTransformer);

499-

vi.doMock("jiti", () => ({ createJiti }));

500507

vi.doMock("./native-module-require.js", () => ({

501508

isJavaScriptModulePath: () => true,

502509

tryNativeRequireJavaScriptModule: () => ({ ok: false }),

@@ -529,7 +536,6 @@ describe("getCachedPluginModuleLoader", () => {

529536

it("skips the native-require fast path when tryNative is explicitly false", async () => {

530537

const fromSourceTransformer = vi.fn(() => ({ fromSourceTransform: true }));

531538

const createJiti = vi.fn(() => fromSourceTransformer);

532-

vi.doMock("jiti", () => ({ createJiti }));

533539

const nativeStub = vi.fn(() => ({ ok: true, moduleExport: { fromNative: true } }));

534540

vi.doMock("./native-module-require.js", () => ({

535541

isJavaScriptModulePath: () => true,

@@ -570,7 +576,6 @@ describe("getCachedPluginModuleLoader", () => {

570576

vi.spyOn(process, "platform", "get").mockReturnValue("win32");

571577

const fromSourceTransformer = vi.fn(() => ({ fromSourceTransform: true }));

572578

const createJiti = vi.fn(() => fromSourceTransformer);

573-

vi.doMock("jiti", () => ({ createJiti }));

574579

const nativeStub = vi.fn(() => ({ ok: true, moduleExport: { fromNative: true } }));

575580

vi.doMock("./native-module-require.js", () => ({

576581

isJavaScriptModulePath: () => true,

@@ -605,7 +610,6 @@ describe("getCachedPluginModuleLoader", () => {

605610

it("forwards extra loader arguments through to the source-transform fallback", async () => {

606611

const fromSourceTransformer = vi.fn(() => ({ fromSourceTransform: true }));

607612

const createJiti = vi.fn(() => fromSourceTransformer);

608-

vi.doMock("jiti", () => ({ createJiti }));

609613

vi.doMock("./native-module-require.js", () => ({

610614

isJavaScriptModulePath: () => true,

611615

tryNativeRequireJavaScriptModule: () => ({ ok: false }),