fix: avoid Discord /tts conflict

This commit is contained in:
Peter Steinberger
2026-01-24 09:58:06 +00:00
parent cfdd5a8c2e
commit c8c58c0537
8 changed files with 52 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest";
import {
buildCommandText,
buildCommandTextFromArgs,
findCommandByNativeName,
getCommandDetection,
listChatCommands,
listChatCommandsForConfig,
@@ -85,6 +86,16 @@ describe("commands registry", () => {
expect(native.find((spec) => spec.name === "demo_skill")).toBeTruthy();
});
it("applies provider-specific native names", () => {
const native = listNativeCommandSpecsForConfig(
{ commands: { native: true } },
{ provider: "discord" },
);
expect(native.find((spec) => spec.name === "voice")).toBeTruthy();
expect(findCommandByNativeName("voice", "discord")?.key).toBe("tts");
expect(findCommandByNativeName("tts", "discord")).toBeUndefined();
});
it("detects known text commands", () => {
const detection = getCommandDetection();
expect(detection.exact.has("/commands")).toBe(true);