Skip to content

test: local js build#88

Merged
syd-shields merged 1 commit intotest-productionfrom
sydshields/dash-1732-turn-existing-templates-in-js-files
May 4, 2026
Merged

test: local js build#88
syd-shields merged 1 commit intotest-productionfrom
sydshields/dash-1732-turn-existing-templates-in-js-files

Conversation

@syd-shields
Copy link
Copy Markdown

@syd-shields syd-shields commented May 4, 2026

Note

Medium Risk
Adds many new runnable templates that automate logins/MFA, proxies, and downloads using real credentials and external sites; main risk is users misconfiguring secrets/logging or brittle flows against third-party UI changes.

Overview
Adds a new set of JavaScript templates (each with README.md, .env.example, and runnable index.js/package.json) demonstrating Stagehand + Browserbase workflows.

New examples cover Amazon scraping and global price comparison via geolocation proxies, action caching, reCAPTCHA solving, agent-driven browsing (including CUA with multiple model providers), bulk form filling, Google Trends extraction, business/license lookups, automated PDF download retrieval, company address discovery, value-prop one-liner generation via llmClient, and MFA flows (manual MFA persistence via Browserbase contexts plus an automated TOTP generator).

Reviewed by Cursor Bugbot for commit 5d56277. Bugbot is set up for automated code reviews on this repo. Configure here.

@syd-shields syd-shields requested a review from a team as a code owner May 4, 2026 17:53
@syd-shields syd-shields merged commit dbee41a into test-production May 4, 2026
3 of 4 checks passed
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5d56277. Configure here.

// Uncomment the line below if you want to submit the form
// await stagehand.act("Click the submit button");
console.log("Form filled successfully! Waiting 3 seconds...");
await page.waitForTimeout(30000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log says 3 seconds but waits 30 seconds

Medium Severity

The log message says "Waiting 3 seconds..." but page.waitForTimeout(30000) actually waits 30 seconds. This 10x discrepancy means the script appears to hang for an unexpectedly long time after form filling completes, confusing anyone running the template.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5d56277. Configure here.

}
console.log();
await stagehand.close();
return { elapsed, llmCalls: cacheFiles > 0 ? 0 : 4 };
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache check after actions gives wrong first-run metrics

Medium Severity

The cache directory is checked for files after the stagehand.act() calls execute with caching enabled. On the first run, those actions populate the cache, so cacheFiles > 0 is true immediately after. This causes the code to incorrectly report "Cost: $0.00 (cache hits, no LLM calls)" and return llmCalls: 0 even though 4 LLM calls were actually made, producing a misleading comparison.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5d56277. Configure here.

resolve();
}
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Race condition: captcha listener registered after page load

High Severity

The page.on("console", ...) listener for browserbase-solving-finished is registered after page.goto() completes. If Browserbase detects and solves the captcha during or shortly after page load, the browserbase-solving-finished event fires before the listener is attached. The Promise will then never resolve, causing the script to hang indefinitely with no timeout.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5d56277. Configure here.

*/
async function createSessionWithContext() {
console.log("Creating new Browserbase context...");
const context = await bb.createContext();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect SDK method bb.createContext() used

High Severity

bb.createContext() is not a standard method on the Browserbase SDK client. All other templates (including context/index.js and the Python manual-mfa-with-contexts) use bb.contexts.create(). This will throw a runtime error when the script runs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5d56277. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant