Skip to content

Commit 80cb25b

Browse files
committed
update scroll tool + system prompt
1 parent 73f2e83 commit 80cb25b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

evals/tasks/agent/steam_games.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const steam_games: EvalFunction = async ({
1212

1313
const agentResult = await agent.execute({
1414
instruction:
15-
"Show most played games in Steam. And tell me the number of players in In game at this time",
15+
"Show most played games in Steam. And tell me the number of players in game at this time",
1616
maxSteps: 30,
1717
});
1818

lib/agent/tools/scroll.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ export const createScrollTool = (page: Page) =>
66
tool({
77
description: "Scroll the page",
88
parameters: z.object({
9-
pixels: z.number().describe("Number of pixels to scroll"),
9+
pixels: z.number().describe("Number of pixels to scroll up or down"),
10+
direction: z.enum(["up", "down"]).describe("Direction to scroll"),
1011
}),
11-
execute: async ({ pixels }) => {
12-
await page.mouse.wheel(0, pixels);
12+
execute: async ({ pixels, direction }) => {
13+
await page.mouse.wheel(0, direction === "up" ? -pixels : pixels);
1314
return { success: true, pixels };
1415
},
1516
});

lib/handlers/stagehandAgentHandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ IMPORTANT GUIDELINES:
172172
2. Use the screenshot tool to verify page state when needed
173173
3. Use appropriate tools for each action
174174
4. When the task is complete, use the "close" tool with taskComplete: true
175-
5. If the task cannot be completed, use "close" with taskComplete: fals
175+
5. If the task cannot be completed, use "close" with taskComplete: false
176176
177177
TOOLS OVERVIEW:
178178
- screenshot: Take a compressed JPEG screenshot for quick visual context (use sparingly)
@@ -181,6 +181,7 @@ TOOLS OVERVIEW:
181181
- extract: Extract structured data
182182
- goto: Navigate to a URL
183183
- wait/navback/refresh: Control timing and navigation
184+
- scroll: Scroll the page x pixels up or down
184185
185186
STRATEGY:
186187
- Prefer ariaTree to understand the page before acting; use screenshot for quick confirmation.

0 commit comments

Comments
 (0)