mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 00:40:22 +00:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user