Files
openclaw/src/discord/monitor/provider.skill-dedupe.test.ts
Shivam 48decefbf4 fix(skills): deduplicate slash commands by skillName across all interfaces
Move skill-command deduplication by skillName from the Discord-only
`dedupeSkillCommandsForDiscord` into `listSkillCommandsForAgents` so
every interface (TUI, Slack, text) consistently sees a clean command
list without platform-specific workarounds.

When multiple agents share a skill with the same name the old code
emitted `github` + `github_2` and relied on Discord to collapse them.
Now `listSkillCommandsForAgents` returns only the first registration
per skillName, and the Discord-specific wrapper is removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 05:11:06 +00:00

38 lines
985 B
TypeScript

import { describe, expect, it } from "vitest";
import { __testing } from "./provider.js";
describe("resolveThreadBindingsEnabled", () => {
it("defaults to enabled when unset", () => {
expect(
__testing.resolveThreadBindingsEnabled({
channelEnabledRaw: undefined,
sessionEnabledRaw: undefined,
}),
).toBe(true);
});
it("uses global session default when channel value is unset", () => {
expect(
__testing.resolveThreadBindingsEnabled({
channelEnabledRaw: undefined,
sessionEnabledRaw: false,
}),
).toBe(false);
});
it("uses channel value to override global session default", () => {
expect(
__testing.resolveThreadBindingsEnabled({
channelEnabledRaw: true,
sessionEnabledRaw: false,
}),
).toBe(true);
expect(
__testing.resolveThreadBindingsEnabled({
channelEnabledRaw: false,
sessionEnabledRaw: true,
}),
).toBe(false);
});
});