fix(telegram): scope default account skill commands to resolved agent (#15599)
This commit is contained in:
committed by
Peter Steinberger
parent
3691631fdc
commit
1d01bb1c8d
@@ -67,7 +67,7 @@ describe("registerTelegramNativeCommands", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps skill commands unscoped without a matching binding", () => {
|
||||
it("scopes skill commands to default agent without a matching binding (#15599)", () => {
|
||||
const cfg: OpenClawConfig = {
|
||||
agents: {
|
||||
list: [{ id: "main", default: true }, { id: "butler" }],
|
||||
@@ -76,7 +76,10 @@ describe("registerTelegramNativeCommands", () => {
|
||||
|
||||
registerTelegramNativeCommands(buildParams(cfg, "bot-a"));
|
||||
|
||||
expect(listSkillCommandsForAgents).toHaveBeenCalledWith({ cfg });
|
||||
expect(listSkillCommandsForAgents).toHaveBeenCalledWith({
|
||||
cfg,
|
||||
agentIds: ["main"],
|
||||
});
|
||||
});
|
||||
|
||||
it("truncates Telegram command registration to 100 commands", () => {
|
||||
|
||||
@@ -295,8 +295,7 @@ export const registerTelegramNativeCommands = ({
|
||||
nativeEnabled && nativeSkillsEnabled
|
||||
? resolveAgentRoute({ cfg, channel: "telegram", accountId })
|
||||
: null;
|
||||
const boundAgentIds =
|
||||
boundRoute && boundRoute.matchedBy.startsWith("binding.") ? [boundRoute.agentId] : null;
|
||||
const boundAgentIds = boundRoute ? [boundRoute.agentId] : null;
|
||||
const skillCommands =
|
||||
nativeEnabled && nativeSkillsEnabled
|
||||
? listSkillCommandsForAgents(boundAgentIds ? { cfg, agentIds: boundAgentIds } : { cfg })
|
||||
|
||||
Reference in New Issue
Block a user