mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 01:50:24 +00:00
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>
38 lines
985 B
TypeScript
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);
|
|
});
|
|
});
|