
























@@ -325,6 +325,29 @@ afterAll(() => {
325325});
326326327327describe("listReadOnlyChannelPluginsForConfig", () => {
328+it("does not load setup-only channel plugin runtime by default", () => {
329+const { pluginDir, fullMarker, setupMarker } = writeExternalSetupChannelPlugin();
330+const plugins = listReadOnlyChannelPluginsForConfig(
331+{
332+channels: {
333+"external-chat": { token: "configured" },
334+},
335+plugins: {
336+load: { paths: [pluginDir] },
337+allow: ["external-chat"],
338+},
339+} as never,
340+{
341+env: { ...process.env },
342+includePersistedAuthState: false,
343+},
344+);
345+346+expect(plugins.some((entry) => entry.id === "external-chat")).toBe(false);
347+expect(fs.existsSync(setupMarker)).toBe(false);
348+expect(fs.existsSync(fullMarker)).toBe(false);
349+});
350+328351it("loads configured external channel setup metadata without importing full runtime", () => {
329352const { pluginDir, fullMarker, setupMarker } = writeExternalSetupChannelPlugin();
330353const plugins = listReadOnlyChannelPluginsForConfig(
@@ -340,6 +363,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
340363{
341364env: { ...process.env },
342365includePersistedAuthState: false,
366+includeSetupRuntimeFallback: true,
343367},
344368);
345369@@ -365,6 +389,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
365389{
366390env: { ...process.env },
367391includePersistedAuthState: false,
392+includeSetupRuntimeFallback: true,
368393},
369394);
370395@@ -396,6 +421,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
396421{
397422env: { ...process.env },
398423includePersistedAuthState: false,
424+includeSetupRuntimeFallback: true,
399425},
400426);
401427@@ -442,6 +468,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
442468{
443469env: { ...process.env },
444470includePersistedAuthState: false,
471+includeSetupRuntimeFallback: true,
445472},
446473);
447474@@ -481,6 +508,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
481508{
482509env: { ...process.env },
483510includePersistedAuthState: false,
511+includeSetupRuntimeFallback: true,
484512},
485513);
486514@@ -711,6 +739,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
711739{
712740env: { ...process.env, EXTERNAL_CHAT_TOKEN: "configured" },
713741includePersistedAuthState: false,
742+includeSetupRuntimeFallback: true,
714743},
715744);
716745@@ -754,6 +783,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
754783{
755784env: { ...process.env, [envVar]: "configured" },
756785includePersistedAuthState: false,
786+includeSetupRuntimeFallback: true,
757787},
758788);
759789@@ -779,6 +809,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
779809{
780810env: { ...process.env, [envVar]: "configured" },
781811includePersistedAuthState: false,
812+includeSetupRuntimeFallback: true,
782813},
783814);
784815@@ -831,6 +862,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
831862EXTERNAL_CHAT_TOKEN: "configured",
832863workspaceDir: "workspace-env-value",
833864},
865+includeSetupRuntimeFallback: true,
834866},
835867);
836868@@ -866,6 +898,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
866898{
867899env: { ...process.env },
868900includePersistedAuthState: false,
901+includeSetupRuntimeFallback: true,
869902},
870903);
871904@@ -894,6 +927,7 @@ describe("listReadOnlyChannelPluginsForConfig", () => {
894927} as never,
895928{
896929env: { ...process.env },
930+includeSetupRuntimeFallback: true,
897931},
898932);
899933此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。