Skip to content

Commit 2e69b21

Browse files
author
Peter Steinberger
committed
fix(canvas): remove unsupported snapshot delay hint
1 parent 03698f9 commit 2e69b21

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎extensions/canvas/src/tool-schema.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
import {
55
optionalFiniteNumberSchema,
6-
optionalNonNegativeIntegerSchema,
76
optionalPositiveIntegerSchema,
87
stringEnum,
98
} from "openclaw/plugin-sdk/channel-actions";
@@ -40,7 +39,6 @@ export const CanvasToolSchema = Type.Object({
4039
outputFormat: Type.Optional(stringEnum(CANVAS_SNAPSHOT_FORMATS)),
4140
maxWidth: optionalPositiveIntegerSchema(),
4241
quality: optionalFiniteNumberSchema({ minimum: 0, maximum: 1 }),
43-
delayMs: optionalNonNegativeIntegerSchema(),
4442
jsonl: Type.Optional(Type.String()),
4543
jsonlPath: Type.Optional(Type.String()),
4644
});

‎extensions/canvas/src/tool.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,18 @@ describe("Canvas tool", () => {
312312
);
313313
expect(mocks.imageResultFromFile).not.toHaveBeenCalled();
314314
});
315+
316+
it("advertises only snapshot controls supported by Canvas nodes", () => {
317+
const schema = createCanvasTool().parameters as {
318+
properties?: Record<string, unknown>;
319+
};
320+
321+
expect(schema.properties?.outputFormat).toMatchObject({
322+
type: "string",
323+
enum: ["png", "jpg", "jpeg"],
324+
});
325+
expect(schema.properties?.maxWidth).toMatchObject({ type: "integer", minimum: 1 });
326+
expect(schema.properties?.quality).toMatchObject({ type: "number", minimum: 0, maximum: 1 });
327+
expect(schema.properties).not.toHaveProperty("delayMs");
328+
});
315329
});

0 commit comments

Comments
 (0)