mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-25 10:03:33 +00:00
fix(slack): rename /status to /agentstatus for Slack slash commands
Slack reserves /status as a built-in command. Registering it in a Slack app manifest returns "invalid name" and invalidates the entire slash_commands array. This adds a Slack provider override using the existing NATIVE_NAME_OVERRIDES system (same pattern as Discord's tts → voice rename) so the handler registers as /agentstatus instead.
This commit is contained in:
@@ -109,6 +109,16 @@ describe("commands registry", () => {
|
||||
expect(findCommandByNativeName("tts", "discord")).toBeUndefined();
|
||||
});
|
||||
|
||||
it("renames status to agentstatus for slack", () => {
|
||||
const native = listNativeCommandSpecsForConfig(
|
||||
{ commands: { native: true } },
|
||||
{ provider: "slack" },
|
||||
);
|
||||
expect(native.find((spec) => spec.name === "agentstatus")).toBeTruthy();
|
||||
expect(native.find((spec) => spec.name === "status")).toBeFalsy();
|
||||
expect(findCommandByNativeName("agentstatus", "slack")?.key).toBe("status");
|
||||
});
|
||||
|
||||
it("keeps discord native command specs within slash-command limits", () => {
|
||||
const native = listNativeCommandSpecsForConfig(
|
||||
{ commands: { native: true } },
|
||||
|
||||
@@ -123,6 +123,11 @@ const NATIVE_NAME_OVERRIDES: Record<string, Record<string, string>> = {
|
||||
discord: {
|
||||
tts: "voice",
|
||||
},
|
||||
slack: {
|
||||
// Slack reserves /status — registering it returns "invalid name"
|
||||
// and invalidates the entire slash_commands manifest array.
|
||||
status: "agentstatus",
|
||||
},
|
||||
};
|
||||
|
||||
function resolveNativeName(command: ChatCommandDefinition, provider?: string): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user