

























@@ -214,6 +214,52 @@ describe("channel package-state probes", () => {
214214).toBe(true);
215215});
216216217+it("preserves parent-mounted source overlay precedence over packaged package-state probes", () => {
218+const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-package-state-parent-overlay-"));
219+tempDirs.push(root);
220+const extensionsRoot = path.join(root, "extensions");
221+const sourceRoot = path.join(extensionsRoot, "matrix");
222+const builtRoot = path.join(root, "dist", "extensions", "matrix");
223+fs.mkdirSync(sourceRoot, { recursive: true });
224+fs.mkdirSync(builtRoot, { recursive: true });
225+fs.writeFileSync(
226+path.join(sourceRoot, "auth-presence.js"),
227+"module.exports.hasAnyMatrixAuth = () => true;\n",
228+"utf8",
229+);
230+fs.writeFileSync(
231+path.join(builtRoot, "auth-presence.js"),
232+"module.exports.hasAnyMatrixAuth = () => false;\n",
233+"utf8",
234+);
235+isBundledSourceOverlayPathMock.mockImplementation(
236+({ sourcePath }: { sourcePath: string }) => path.resolve(sourcePath) === extensionsRoot,
237+);
238+239+listChannelCatalogEntriesMock.mockReturnValue([
240+{
241+pluginId: "matrix",
242+origin: "bundled",
243+rootDir: sourceRoot,
244+channel: {
245+id: "matrix",
246+persistedAuthState: {
247+specifier: "./auth-presence",
248+exportName: "hasAnyMatrixAuth",
249+},
250+},
251+} satisfies PluginChannelCatalogEntry,
252+]);
253+254+expect(
255+hasBundledChannelPackageState({
256+metadataKey: "persistedAuthState",
257+channelId: "matrix",
258+cfg: {},
259+}),
260+).toBe(true);
261+});
262+217263it("tries dist-runtime package-state probes before falling back to source", () => {
218264const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-package-state-runtime-"));
219265tempDirs.push(root);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。