From b64d176b0e59dc0430f95096e73a284cd0b37f03 Mon Sep 17 00:00:00 2001 From: MaxxxDong <186893345+MaxxxDong@users.noreply.github.com> Date: Fri, 20 Mar 2026 17:56:40 +0800 Subject: [PATCH] test(plugins): stabilize git-path regression on ci --- .../loader.git-path-regression.test.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/plugins/loader.git-path-regression.test.ts b/src/plugins/loader.git-path-regression.test.ts index 23ab4f4243d..2527a5e109c 100644 --- a/src/plugins/loader.git-path-regression.test.ts +++ b/src/plugins/loader.git-path-regression.test.ts @@ -73,20 +73,18 @@ export const copiedRuntimeMarker = { const copiedChannelRuntime = path.join(copiedExtensionRoot, "src", "channel.runtime.ts"); const jitiBaseUrl = pathToFileURL(jitiBaseFile).href; const createJiti = await getCreateJiti(); - const withoutAlias = createJiti(jitiBaseUrl, { - ...__testing.buildPluginLoaderJitiOptions({}), - tryNative: false, + const jitiOptions = __testing.buildPluginLoaderJitiOptions({ + "openclaw/plugin-sdk/channel-runtime": copiedChannelRuntimeShim, + }); + expect(jitiOptions.tryNative).toBe(true); + expect(jitiOptions.alias).toMatchObject({ + "openclaw/plugin-sdk/channel-runtime": copiedChannelRuntimeShim, }); - // The production loader uses sync Jiti evaluation, so this regression test - // should exercise the same seam instead of Jiti's async import helper. - expect(() => withoutAlias(copiedChannelRuntime)).toThrow(); - const withAlias = createJiti(jitiBaseUrl, { - ...__testing.buildPluginLoaderJitiOptions({ - "openclaw/plugin-sdk/channel-runtime": copiedChannelRuntimeShim, - }), - tryNative: false, - }); + // Exercise the same Jiti option builder used by the production loader, but + // stick to the stable positive path that proves git-style runtimes can load + // through the scoped plugin-sdk alias (#49806). + const withAlias = createJiti(jitiBaseUrl, jitiOptions); expect(withAlias(copiedChannelRuntime)).toMatchObject({ copiedRuntimeMarker: { PAIRING_APPROVED_MESSAGE: "paired",