fix(ci): preserve channel auto-enable metadata

This commit is contained in:
Peter Steinberger
2026-04-11 14:02:59 +01:00
parent 564f64666b
commit b646655a2d
2 changed files with 16 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import { normalizeChatChannelId } from "../channels/registry.js";
import { getChatChannelMeta, normalizeChatChannelId } from "../channels/registry.js";
import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";
import { normalizeOptionalString } from "../shared/string-coerce.js";
import { normalizeStringEntries } from "../shared/string-normalization.js";
@@ -106,6 +106,10 @@ function resolvePreferredOverIds(
if (installedChannelMeta?.preferOver?.length) {
return [...installedChannelMeta.preferOver];
}
const bundledChannelMeta = getChatChannelMeta(normalized);
if (bundledChannelMeta?.preferOver?.length) {
return [...bundledChannelMeta.preferOver];
}
return resolveExternalCatalogPreferOver(pluginId, env);
}

View File

@@ -3,7 +3,7 @@ import {
hasPotentialConfiguredChannels,
listPotentialConfiguredChannelIds,
} from "../channels/config-presence.js";
import { normalizeChatChannelId } from "../channels/registry.js";
import { getChatChannelMeta, normalizeChatChannelId } from "../channels/registry.js";
import {
loadPluginManifestRegistry,
resolveManifestContractOwnerPluginId,
@@ -608,8 +608,17 @@ function materializeConfiguredPluginEntryAllowlist(params: {
return next;
}
function resolveAutoEnableChangeReason(entry: PluginAutoEnableCandidate): string {
if (entry.kind !== "channel-configured") {
return resolvePluginAutoEnableCandidateReason(entry);
}
const channelId = normalizeChatChannelId(entry.channelId);
const label = channelId ? getChatChannelMeta(channelId)?.label : undefined;
return `${label ?? entry.channelId} configured`;
}
function formatAutoEnableChange(entry: PluginAutoEnableCandidate): string {
return `${resolvePluginAutoEnableCandidateReason(entry).trim()}, enabled automatically.`;
return `${resolveAutoEnableChangeReason(entry).trim()}, enabled automatically.`;
}
export function resolvePluginAutoEnableManifestRegistry(params: {