Skip to content

fix chunking in old act #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fluffy-pumas-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@browserbasehq/stagehand": patch
---

fix: continuously adjusting chunk size inside `act`
5 changes: 4 additions & 1 deletion evals/tasks/wikipedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export const wikipedia: EvalFunction = async ({ modelName, logger }) => {
const { debugUrl, sessionUrl } = initResponse;

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

const url = "https://en.wikipedia.org/wiki/Hit_and_run_(baseball)";
const currentUrl = stagehand.page.url();
Expand Down
2 changes: 1 addition & 1 deletion lib/dom/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function debugDom() {
chunkSize,
false,
false, // Don't scroll back to top
undefined, // BFS entire doc
container.getRootElement(), // BFS entire doc
);

// We expect exactly 1 chunk
Expand Down
2 changes: 1 addition & 1 deletion lib/dom/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export async function processDom(chunksSeen: number[]) {
chunkSize,
true,
false, // scrollBackToTop
undefined, // BFS entire doc
container.getRootElement(), // BFS entire doc
);

// We expect exactly 1 chunk
Expand Down