test: local js build#88
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
❌ 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); |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 5d56277. Configure here.
| } | ||
| console.log(); | ||
| await stagehand.close(); | ||
| return { elapsed, llmCalls: cacheFiles > 0 ? 0 : 4 }; |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 5d56277. Configure here.
| resolve(); | ||
| } | ||
| }); | ||
| }); |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 5d56277. Configure here.
| */ | ||
| async function createSessionWithContext() { | ||
| console.log("Creating new Browserbase context..."); | ||
| const context = await bb.createContext(); |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 5d56277. Configure here.


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 runnableindex.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.