fix: make buttons schema optional in message tool (#54418)

Merged via squash.

Prepared head SHA: 0805c095e9
Co-authored-by: adzendo <246828680+adzendo@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
adzendo
2026-03-25 18:43:15 -05:00
committed by GitHub
parent b6f631e045
commit 19d91aaa8f
5 changed files with 32 additions and 11 deletions

View File

@@ -479,6 +479,24 @@ describe("message tool schema scoping", () => {
},
);
it("keeps buttons schema optional so plain sends do not require buttons", () => {
setActivePluginRegistry(
createTestRegistry([{ pluginId: "telegram", source: "test", plugin: telegramPlugin }]),
);
const tool = createMessageTool({
config: {} as never,
currentChannelProvider: "telegram",
});
const schema = tool.parameters as {
properties?: Record<string, unknown>;
required?: string[];
};
expect(schema.properties?.buttons).toBeDefined();
expect(schema.required ?? []).not.toContain("buttons");
});
it("hides telegram poll extras when telegram polls are disabled in scoped mode", () => {
const telegramPluginWithConfig = createChannelPlugin({
id: "telegram",