mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 02:51:39 +00:00
fix(canvas): remove unsupported snapshot delay hint (#117326)
Co-authored-by: Peter Steinberger <steipete@macos.shared>
This commit is contained in:
committed by
GitHub
parent
1e34c2d073
commit
3edbe19fbd
@@ -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()),
|
||||
});
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user