Skip to content

Commit 3edbe19

Browse files
steipetePeter Steinberger
andauthored
fix(canvas): remove unsupported snapshot delay hint (#117326)
Co-authored-by: Peter Steinberger <[email protected]>
1 parent 1e34c2d commit 3edbe19

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
@@ -377,4 +377,18 @@ describe("Canvas tool", () => {
377377
);
378378
expect(mocks.imageResultFromFile).not.toHaveBeenCalled();
379379
});
380+
381+
it("advertises only snapshot controls supported by Canvas nodes", () => {
382+
const schema = createCanvasTool().parameters as {
383+
properties?: Record<string, unknown>;
384+
};
385+
386+
expect(schema.properties?.outputFormat).toMatchObject({
387+
type: "string",
388+
enum: ["png", "jpg", "jpeg"],
389+
});
390+
expect(schema.properties?.maxWidth).toMatchObject({ type: "integer", minimum: 1 });
391+
expect(schema.properties?.quality).toMatchObject({ type: "number", minimum: 0, maximum: 1 });
392+
expect(schema.properties).not.toHaveProperty("delayMs");
393+
});
380394
});

0 commit comments

Comments
 (0)