






























@@ -2785,7 +2785,7 @@ module.exports = {
27852785{
27862786label: "loads plugins from config paths",
27872787run: () => {
2788-process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins";
2788+useNoBundledPlugins();
27892789const plugin = writePlugin({
27902790id: "allowed-config-path",
27912791filename: "allowed-config-path.cjs",
@@ -4373,7 +4373,7 @@ module.exports = { id: "throws-after-import", register() {} };`,
43734373});
4374437443754375it("re-initializes global hook runner when serving registry from cache", () => {
4376-process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins";
4376+useNoBundledPlugins();
43774377const plugin = writePlugin({
43784378id: "cache-hook-runner",
43794379filename: "cache-hook-runner.cjs",
@@ -6604,7 +6604,6 @@ module.exports = {
66046604{
66056605label: "enforces memory slot selection",
66066606loadRegistry: () => {
6607-process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins";
66086607const memoryA = writePlugin({
66096608id: "memory-a",
66106609body: memoryPluginBody("memory-a"),
@@ -6614,15 +6613,22 @@ module.exports = {
66146613body: memoryPluginBody("memory-b"),
66156614});
661666156617-return loadOpenClawPlugins({
6618-cache: false,
6619-config: {
6620-plugins: {
6621-load: { paths: [memoryA.file, memoryB.file] },
6622-slots: { memory: "memory-b" },
6623-},
6616+return withEnv(
6617+{
6618+OPENCLAW_DISABLE_BUNDLED_PLUGINS: "1",
6619+OPENCLAW_BUNDLED_PLUGINS_DIR: undefined,
66246620},
6625-});
6621+() =>
6622+loadOpenClawPlugins({
6623+cache: false,
6624+config: {
6625+plugins: {
6626+load: { paths: [memoryA.file, memoryB.file] },
6627+slots: { memory: "memory-b" },
6628+},
6629+},
6630+}),
6631+);
66266632},
66276633assert: (registry: ReturnType<typeof loadOpenClawPlugins>) => {
66286634const a = registry.plugins.find((entry) => entry.id === "memory-a");
@@ -6871,21 +6877,27 @@ module.exports = {
68716877{
68726878label: "disables memory plugins when slot is none",
68736879loadRegistry: () => {
6874-process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins";
68756880const memory = writePlugin({
68766881id: "memory-off",
68776882body: memoryPluginBody("memory-off"),
68786883});
687968846880-return loadOpenClawPlugins({
6881-cache: false,
6882-config: {
6883-plugins: {
6884-load: { paths: [memory.file] },
6885-slots: { memory: "none" },
6886-},
6885+return withEnv(
6886+{
6887+OPENCLAW_DISABLE_BUNDLED_PLUGINS: "1",
6888+OPENCLAW_BUNDLED_PLUGINS_DIR: undefined,
68876889},
6888-});
6890+() =>
6891+loadOpenClawPlugins({
6892+cache: false,
6893+config: {
6894+plugins: {
6895+load: { paths: [memory.file] },
6896+slots: { memory: "none" },
6897+},
6898+},
6899+}),
6900+);
68896901},
68906902assert: (registry: ReturnType<typeof loadOpenClawPlugins>) => {
68916903const entry = registry.plugins.find((item) => item.id === "memory-off");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。