fix: allow plugin commands on Slack when channel supports native commands (#64578)

Merged via squash.

Prepared head SHA: 2ec97bf0b3
Co-authored-by: rafaelreis-r <57492577+rafaelreis-r@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
rafaelreis-r
2026-04-13 17:14:02 -03:00
committed by GitHub
parent ce1fffa97e
commit 68e0e456f3
8 changed files with 68 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import { createChannelReplyPipeline } from "openclaw/plugin-sdk/channel-reply-pi
import {
resolveCommandAuthorizedFromAuthorizers,
resolveNativeCommandSessionTargets,
listProviderPluginCommandSpecs,
} from "openclaw/plugin-sdk/command-auth";
import { type ChatCommandDefinition, type CommandArgs } from "openclaw/plugin-sdk/command-auth";
import {
@@ -670,6 +671,17 @@ export async function registerSlackMonitorSlashCommands(params: {
skillCommands,
provider: "slack",
});
const existingNativeNames = new Set(
nativeCommands.map((c) => normalizeLowercaseStringOrEmpty(c.name)).filter(Boolean),
);
for (const pluginCommand of listProviderPluginCommandSpecs("slack")) {
const normalizedName = normalizeLowercaseStringOrEmpty(pluginCommand.name);
if (!normalizedName || existingNativeNames.has(normalizedName)) {
continue;
}
existingNativeNames.add(normalizedName);
nativeCommands.push(pluginCommand);
}
}
if (nativeCommands.length > 0) {