Skip to content

Commit 18533ad

Browse files
fix chunking in old act (#559)
1 parent 55c9673 commit 18533ad

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Diff for: .changeset/fluffy-pumas-do.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@browserbasehq/stagehand": patch
3+
---
4+
5+
fix: continuously adjusting chunk size inside `act`

Diff for: evals/tasks/wikipedia.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export const wikipedia: EvalFunction = async ({ modelName, logger }) => {
1010
const { debugUrl, sessionUrl } = initResponse;
1111

1212
await stagehand.page.goto(`https://en.wikipedia.org/wiki/Baseball`);
13-
await stagehand.page.act('click the "hit and run" link in this article');
13+
await stagehand.page.act({
14+
action: 'click the "hit and run" link in this article',
15+
timeoutMs: 360_000,
16+
});
1417

1518
const url = "https://en.wikipedia.org/wiki/Hit_and_run_(baseball)";
1619
const currentUrl = stagehand.page.url();

Diff for: lib/dom/debug.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function debugDom() {
2323
chunkSize,
2424
false,
2525
false, // Don't scroll back to top
26-
undefined, // BFS entire doc
26+
container.getRootElement(), // BFS entire doc
2727
);
2828

2929
// We expect exactly 1 chunk

Diff for: lib/dom/process.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export async function processDom(chunksSeen: number[]) {
127127
chunkSize,
128128
true,
129129
false, // scrollBackToTop
130-
undefined, // BFS entire doc
130+
container.getRootElement(), // BFS entire doc
131131
);
132132

133133
// We expect exactly 1 chunk

0 commit comments

Comments
 (0)