Migrate all Stagehand templates to V4 - #101
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f5a9cbd. Configure here.
| if (!selection.data.success) { | ||
| throw new Error(selection.data.message || `Could not select ${CURRENT_YEAR}`); | ||
| } | ||
| await page.waitForLoadState("domcontentloaded"); |
There was a problem hiding this comment.
Year filter wait is ineffective
Medium Severity
After selecting the calendar year, waitForLoadState("domcontentloaded") does not wait for the Legistar table refresh. The page is already at that load state from goto, and year changes on this ASP.NET calendar often update via postback/AJAX without a new document load, so extraction can run against a stale year view.
Reviewed by Cursor Bugbot for commit f5a9cbd. Configure here.
| console.log(`Found ${results.results.length} events`); | ||
| if (results.results.length === 0) { | ||
| throw new Error(`No ${CURRENT_YEAR} council events were extracted`); | ||
| } |
There was a problem hiding this comment.
Missing year outcome validation
Medium Severity
The new success check only requires a non-empty event list for CURRENT_YEAR. It never verifies that extracted date values actually contain that year, so a stale or mis-filtered calendar table can still pass.
Reviewed by Cursor Bugbot for commit f5a9cbd. Configure here.


Summary
Stagehand is the SDK for browser agents.
@browserbasehq/stagehand@4.0.0andstagehand==4.0.0for the core SDKsbrowserbase.launch()/localBrowser.launch(),Stagehand.create({ browser }),browser.context, V4{ data, metadata }envelopes,locator(), and explicit Stagehand-then-browser cleanupCompanion PR: browserbase/create-browser-app#40
Agent migration: 14 templates
Nine TypeScript templates use Vercel AI SDK
ToolLoopAgentwith Stagehand code mode's statefulcode_executetool:typescript/agent-with-human-in-looptypescript/browser-agent-demotypescript/business-lookuptypescript/company-address-findertypescript/dynamic-form-fillingtypescript/exa-browserbasetypescript/gemini-3-flashtypescript/gemini-cuatypescript/microsoft-cuaFive Python templates use Deep Agents with the Stagehand integration's stateful browser tools:
python/business-lookuppython/cerebras-docs-checkerpython/company-address-finderpython/exa-browserbasepython/gemini-cuaThe Go template's removed autonomous
Sessions.Executestep is now an explicit, verifiable V4Observe→Act→ typedExtractworkflow.Package state
@browserbasehq/stagehand@4.0.0stagehand==4.0.054302fc5f13be5ad8e717d8e1388502de22be2eduntil@browserbasehq/stagehand-codemodeis publishedstagehand/mainsource (packages/integrations/deepagents), with its server dependency on publishedstagehand==4.0.0v0.0.0-20260810174315-a46676658b4funtil the module is taggedThe code-mode Git dependency needs two temporary measures until publication: the pnpm subdirectory selector must be
path:packages/integrations(no leading slash), and pnpm overrides must resolve the upstream monorepo'sworkspace:/catalog:dependencies. These are now present in all nine manifests.Fresh E2E re-verification — 2026-08-18
This section replaces all historical E2E claims. Every executable entrypoint was freshly installed and invoked against the current PR head. No earlier run was counted as evidence.
There are 77 first-level language directories but 79 executable entrypoints: 68 Stagehand flows and 11 non-Stagehand flows. The previous description's “10 executable non-Stagehand flows” missed that both TypeScript and Python Playwright directories each contain two entrypoints.
Strict current result
f5a9cbdThe V3 side is a reconstructed behavioral baseline using the final V3 releases (
@browserbasehq/stagehand@3.7.1,stagehand==3.22.0). A literal clean install of several base-branch manifests is no longer reproducible because they usedlatestor open-ended constraints that now resolve V4.Legend: FIXED means the fresh pre-fix V4 run failed and the exact post-fix rerun passed. BLOCKED is not counted as a pass.
TypeScript Stagehand — 35 entrypoints
agent-with-human-in-loopamazon-global-price-comparisonamazon-product-scrapingbasic-cachingbasic-recaptchabrowser-agent-demobrowserbase-reductobusiness-lookupcompany-address-findercompany-value-prop-generatorcontextSF_REC_PARK_EMAIL/SF_REC_PARK_PASSWORD.council-eventsdownload-financial-statementsdynamic-form-fillingexa-browserbaseextend-browserbaseform-fillinggemini-3-flashgemini-cuagift-findergoogle-trendsimage-url-downloadjob-applicationlicense-verification02237476.manual-mfa-with-contextsmfa-handlingmicrosoft-cuanurse-verification346, Active.pickleballpolymarket-researchproxiesproxies-weathersec-filing-researchsmart-fetch-scraperwebsite-link-tester/templates/amazon-price-comparison). Expected nonzero exit proves the checker caught the site issue.Python Stagehand — 32 entrypoints
amazon-global-price-comparisonamazon-product-scrapingbasic-cachingbasic-recaptchabrowserbase-reductobusiness-lookupcartesia-form-fillingcerebras-docs-checkercompany-address-findercompany-value-prop-generatorcontextcouncil-eventsdownload-financial-statementsexa-browserbaseextend-browserbaseform-fillinggemini-cuagift-findergoogle-trendsimage-url-downloadjob-applicationlicense-verificationmanual-mfa-with-contextsmfa-handlingnurse-verification346.pickleballpolymarket-researchproxiesproxies-weathersec-filing-researchsmart-fetch-scraperwebsite-link-testerGo Stagehand — 1 entrypoint
hackernewsNon-Stagehand — 9 directories / 11 entrypoints
getting-started-with-browserbaseplaywright/basic-recaptchaplaywright/quickstart-playwrightplaywright-mfa-handlingpuppeteer/quickstart-puppeteerselenium/quickstart-seleniumgetting-started-with-browserbaseplaywright/basic-recaptchaplaywright/quickstart-playwrightplaywright-mfa-handlingselenium/quickstart-seleniumFixes added from the fresh audit
Commit
f5a9cbd:Repository proof
git diff --checkpass.envfiles are includedRemaining work before claiming 100%
exa-browserbase(default and one-company runs fail)exa-browserbaseat the default five-company workloadgemini-cuaCDP/TaskGroup failuregemini-3-flashand the Python link tester under repeated/stress runs@browserbasehq/stagehand-codemode@4.0.0, then remove the temporary Git pin/overridesNote
Cursor Bugbot will update its generated summary for the latest commit.