fix: advertise telegram poll duration integer · openclaw/openclaw@edda060
steipete
·
2026-05-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -367,6 +367,25 @@ describe("telegramMessageActions", () => {
|
367 | 367 | expect(discovery?.actions).not.toContain("react"); |
368 | 368 | }); |
369 | 369 | |
| 370 | +it("advertises poll duration as a positive integer in message tool schema", () => { |
| 371 | +const cfg = { |
| 372 | +channels: { |
| 373 | +telegram: { |
| 374 | +botToken: "tok", |
| 375 | +actions: { poll: true }, |
| 376 | +}, |
| 377 | +}, |
| 378 | +} as OpenClawConfig; |
| 379 | + |
| 380 | +const discovery = telegramMessageActions.describeMessageTool?.({ cfg }); |
| 381 | +const schema = Array.isArray(discovery?.schema) ? discovery.schema[0] : undefined; |
| 382 | + |
| 383 | +expect(schema?.properties.pollDurationSeconds).toMatchObject({ |
| 384 | +type: "integer", |
| 385 | +minimum: 1, |
| 386 | +}); |
| 387 | +}); |
| 388 | + |
370 | 389 | it("matches runtime account-key normalization during SecretRef-tolerant discovery", () => { |
371 | 390 | const cfg = { |
372 | 391 | channels: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions"; |
1 | 2 | import { Type } from "typebox"; |
2 | 3 | |
3 | 4 | export function createTelegramPollExtraToolSchemas() { |
4 | 5 | return { |
5 | | -pollDurationSeconds: Type.Optional(Type.Number()), |
| 6 | +pollDurationSeconds: optionalPositiveIntegerSchema(), |
6 | 7 | pollAnonymous: Type.Optional(Type.Boolean()), |
7 | 8 | pollPublic: Type.Optional(Type.Boolean()), |
8 | 9 | }; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。