Add deep research agent template#90
Conversation
|
bugbot run verbose=true |
|
Bugbot request id: serverGenReqId_99a1e2b6-44c5-4517-8468-61436b1da0dc |
| } | ||
|
|
||
| if (url.pathname === "/research" || url.pathname === "/api/research") { | ||
| return options.handleResearch(request, response); |
There was a problem hiding this comment.
Missing await bypasses error handler in try-catch
Medium Severity
The return options.handleResearch(request, response) inside the try-catch of handleDashboardRequest is missing await. In an async function, return promise without await causes the catch block to never intercept async rejections from that promise. If the research handler throws asynchronously outside its own inner try-catch (e.g., a stream error during readBody in local-web.ts), the outer safety-net catch is silently bypassed, resulting in an unhandled promise rejection and a hanging HTTP response that never completes.
Reviewed by Cursor Bugbot for commit 6c6204e. Configure here.
| return sendJson(response, 400, { error: "Enter a research topic." }); | ||
| } | ||
|
|
||
| activeRun = true; |
There was a problem hiding this comment.
Race condition in concurrent run guard
Low Severity
The activeRun guard is checked before await readBody(request) but only set to true after it. During that await, the event loop can process another incoming request that also passes the activeRun check, allowing multiple concurrent research runs — exactly what the guard is designed to prevent (a classic TOCTOU race).
Reviewed by Cursor Bugbot for commit 72a8f92. Configure here.
| summary: | ||
| overallScore >= input.rubric.passThreshold | ||
| ? "Verification passed the conservative rubric." | ||
| : "Verification did not pass; review repair actions before using the report.", |
There was a problem hiding this comment.
Verification summary contradicts pass field
Medium Severity
The summary message is determined solely by overallScore >= passThreshold, but the pass field additionally requires missingCriteria.length === 0. When the score clears the threshold but missingCriteria is non-empty, pass is false while summary says "Verification passed the conservative rubric." — a direct contradiction that is surfaced in both the dashboard UI overview panel and the written verification.md artifact.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c7da4fe. Configure here.
| throw new Error("No page found in Browserbase session"); | ||
| } | ||
|
|
||
| await page.goto(candidate.url, { waitUntil: "domcontentloaded", timeoutMs: 45000 }); |
There was a problem hiding this comment.
Playwright goto timeout option silently ignored
Low Severity
The browser-fallback navigation call passes { timeoutMs: 45000 } to Playwright's page.goto(), but the Playwright API expects { timeout: number }, not timeoutMs. The unrecognized property is silently discarded at runtime, so the intended 45-second timeout for slow or JS-heavy pages is never applied and the default 30-second Playwright timeout is used instead. Every other page.goto call in this file correctly omits a custom timeout, making this the only place where the wrong key name appears.
Reviewed by Cursor Bugbot for commit c7da4fe. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 5 total unresolved issues (including 4 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fba2b10. Configure here.
| return options.handleResearch(request, response); | ||
| } | ||
|
|
||
| return sendJson(response, 404, { error: "Not found." }); |
There was a problem hiding this comment.
Dashboard logo fails to load via local server
Low Severity
handleDashboardRequest only routes /, /index.html, health, and research paths — it has no static file handler. The dashboard HTML references <img src="browserbase-logo.svg">, so the browser requests /browserbase-logo.svg which hits the 404 fallback and returns a JSON error instead of the SVG. The logo is broken in both npm run web and the Vercel index.ts handler.
Reviewed by Cursor Bugbot for commit fba2b10. Configure here.
fba2b10 to
c7da4fe
Compare


Summary
typescript/deep-research-agenttemplate for bb research engineVerification
npm run checknode scripts/check-readme-template-index.mjsReplaces #89 so the branch name does not include the
codex/prefix.Note
Medium Risk
Adds a sizable new TypeScript template that runs multi-step live-web research via Browserbase Search/Fetch and Stagehand, plus exposes new local and Vercel HTTP endpoints; risk is mainly around runtime behavior, cost/limits, and serverless execution constraints rather than existing code changes.
Overview
Adds a new
typescript/deep-research-agenttemplate that turns a topic into an auditable, cited research brief using Browserbase Search + Fetch first and Stagehand browser-session fallback, with optional planning/strategy iterations and a verifier step.Includes a lightweight dashboard UI (
public/index.html) with a local server (src/local-web.ts) and Vercel-ready handlers (index.ts,api/health.ts,api/research.ts,vercel.json) that accept a topic, run the pipeline, and return a structured JSON response plus artifact paths.Updates the root
README.mdtemplates table to listdeep-research-agent, and adds template packaging/config files (package.json,.env.example,.gitignore,benchmark.example.tsv).Reviewed by Cursor Bugbot for commit fba2b10. Bugbot is set up for automated code reviews on this repo. Configure here.