mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-31 14:38:33 +00:00
fix: advertise telegram poll duration integer
This commit is contained in:
@@ -367,6 +367,25 @@ describe("telegramMessageActions", () => {
|
||||
expect(discovery?.actions).not.toContain("react");
|
||||
});
|
||||
|
||||
it("advertises poll duration as a positive integer in message tool schema", () => {
|
||||
const cfg = {
|
||||
channels: {
|
||||
telegram: {
|
||||
botToken: "tok",
|
||||
actions: { poll: true },
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig;
|
||||
|
||||
const discovery = telegramMessageActions.describeMessageTool?.({ cfg });
|
||||
const schema = Array.isArray(discovery?.schema) ? discovery.schema[0] : undefined;
|
||||
|
||||
expect(schema?.properties.pollDurationSeconds).toMatchObject({
|
||||
type: "integer",
|
||||
minimum: 1,
|
||||
});
|
||||
});
|
||||
|
||||
it("matches runtime account-key normalization during SecretRef-tolerant discovery", () => {
|
||||
const cfg = {
|
||||
channels: {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
|
||||
import { Type } from "typebox";
|
||||
|
||||
export function createTelegramPollExtraToolSchemas() {
|
||||
return {
|
||||
pollDurationSeconds: Type.Optional(Type.Number()),
|
||||
pollDurationSeconds: optionalPositiveIntegerSchema(),
|
||||
pollAnonymous: Type.Optional(Type.Boolean()),
|
||||
pollPublic: Type.Optional(Type.Boolean()),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user