diff --git a/src/helpers/rpc/performAction.ts b/src/helpers/rpc/performAction.ts index 78ab45a..26437f6 100644 --- a/src/helpers/rpc/performAction.ts +++ b/src/helpers/rpc/performAction.ts @@ -140,7 +140,7 @@ function createOperateTool( console.log("operateTool", action); switch (action.name) { case "scroll": - await scroll(domActions, action?.args?.value ?? "down"); + await scroll(domActions, action.args.value); break; case "wait": await sleep(3000); diff --git a/src/helpers/vision-agent/tools.ts b/src/helpers/vision-agent/tools.ts index 9059170..569afab 100644 --- a/src/helpers/vision-agent/tools.ts +++ b/src/helpers/vision-agent/tools.ts @@ -55,11 +55,9 @@ export const scrollSchema = z.object({ 'Scroll the page to see the other parts. Use "up" or "down" to scroll 2/3 of height of the window. Use "top" or "bottom" to quickly scroll to the top or bottom of the page.', ) .optional(), - args: z - .object({ - value: z.string(), - }) - .optional(), + args: z.object({ + value: z.string(), + }), }); export const waitSchema = z.object({