fix(canvas): remove unsupported snapshot delay hint (#117326)

Co-authored-by: Peter Steinberger <steipete@macos.shared>
This commit is contained in:
Peter Steinberger
2026-08-01 02:44:22 -07:00
committed by GitHub
parent 1e34c2d073
commit 3edbe19fbd
2 changed files with 14 additions and 2 deletions

View File

@@ -3,7 +3,6 @@
*/
import {
optionalFiniteNumberSchema,
optionalNonNegativeIntegerSchema,
optionalPositiveIntegerSchema,
stringEnum,
} from "openclaw/plugin-sdk/channel-actions";
@@ -40,7 +39,6 @@ export const CanvasToolSchema = Type.Object({
outputFormat: Type.Optional(stringEnum(CANVAS_SNAPSHOT_FORMATS)),
maxWidth: optionalPositiveIntegerSchema(),
quality: optionalFiniteNumberSchema({ minimum: 0, maximum: 1 }),
delayMs: optionalNonNegativeIntegerSchema(),
jsonl: Type.Optional(Type.String()),
jsonlPath: Type.Optional(Type.String()),
});

View File

@@ -377,4 +377,18 @@ describe("Canvas tool", () => {
);
expect(mocks.imageResultFromFile).not.toHaveBeenCalled();
});
it("advertises only snapshot controls supported by Canvas nodes", () => {
const schema = createCanvasTool().parameters as {
properties?: Record<string, unknown>;
};
expect(schema.properties?.outputFormat).toMatchObject({
type: "string",
enum: ["png", "jpg", "jpeg"],
});
expect(schema.properties?.maxWidth).toMatchObject({ type: "integer", minimum: 1 });
expect(schema.properties?.quality).toMatchObject({ type: "number", minimum: 0, maximum: 1 });
expect(schema.properties).not.toHaveProperty("delayMs");
});
});