refactor(plugins): separate activation from enablement (#59844)

* refactor(plugins): separate activation from enablement

* fix(cli): sanitize verbose plugin activation reasons
This commit is contained in:
Vincent Koc
2026-04-03 03:22:37 +09:00
committed by GitHub
parent 4aeb0255f3
commit f911bbc353
15 changed files with 148 additions and 42 deletions

View File

@@ -171,7 +171,11 @@ describe("gateway send mirroring", () => {
vi.clearAllMocks();
registrySeq += 1;
setActivePluginRegistry(createTestRegistry([]), `send-test-${registrySeq}`);
mocks.applyPluginAutoEnable.mockImplementation(({ config }) => ({ config, changes: [] }));
mocks.applyPluginAutoEnable.mockImplementation(({ config }) => ({
config,
changes: [],
autoEnabledReasons: {},
}));
mocks.resolveOutboundTarget.mockReturnValue({ ok: true, to: "resolved" });
mocks.resolveOutboundSessionRoute.mockImplementation(
async ({ agentId, channel }: { agentId?: string; channel?: string }) => ({
@@ -319,7 +323,11 @@ describe("gateway send mirroring", () => {
it("auto-picks the single configured channel from the auto-enabled config snapshot for send", async () => {
const autoEnabledConfig = { channels: { slack: {} }, plugins: { allow: ["slack"] } };
mocks.applyPluginAutoEnable.mockReturnValue({ config: autoEnabledConfig, changes: [] });
mocks.applyPluginAutoEnable.mockReturnValue({
config: autoEnabledConfig,
changes: [],
autoEnabledReasons: {},
});
mockDeliverySuccess("m-single-send-auto");
const { respond } = await runSend({