Skip to content

Update deep research agent template dashboard#90

Open
shriyatheunicorn wants to merge 20 commits into
devfrom
add-deep-research-agent-template
Open

Update deep research agent template dashboard#90
shriyatheunicorn wants to merge 20 commits into
devfrom
add-deep-research-agent-template

Conversation

@shriyatheunicorn
Copy link
Copy Markdown

@shriyatheunicorn shriyatheunicorn commented May 6, 2026

Summary

  • update the deep research agent dashboard to match the Browserbase Vercel preview styling
  • add the Browserbase logo asset, simplified topbar branding, static pipeline details, and clearer raw output labeling
  • keep direct file:// opens pointed at local dev API candidates instead of an external deployment
  • remove the root index.ts Vercel function config so the static public/ UI plus /api/research deploy cleanly in the Browserbase Vercel project
  • address Cursor Bugbot findings around async error handling, local concurrency, static logo serving, verifier summary consistency, source-domain caps, and failed pipeline styling
  • remove the old hidden sidebar markup and dead sidebar interactions

Verification

  • npm run check
  • node scripts/check-readme-template-index.mjs
  • inline dashboard script syntax check
  • local server smoke check for /, /api/health, and /browserbase-logo.svg

Note

Medium Risk
Large new surface area (long-running research jobs, Browserbase/Stagehand calls, open CORS on dashboard helpers) and cost/latency exposure from misconfigured env limits, but scoped to an optional demo template rather than shared production services.

Overview
Adds the deep-research-agent TypeScript template to the repo index and ships a full bb research engine: CLI (npm start), local dashboard (npm run web), optional benchmark mode, and Vercel serverless entrypoints.

The dashboard is reworked around Browserbase preview styling—logo asset, simplified topbar, a static six-step pipeline timeline with run/fail highlighting, loading ETA UI, and tabbed results (overview, findings, sources, raw JSON). Opening public/index.html via file:// probes local API hosts (localhost:3000 / 3210) before posting to /api/research.

Deployment uses public/ for static UI, api/health.ts and api/research.ts (300s max duration), and vercel.json rewrites for /health and /research. Shared routing lives in src/api-utils.ts (HTML/CSS/logo serving, CORS, JSON research responses); the local server adds a 409 guard when a run is already in progress.

The core pipeline in src/research.ts plans and verifies research with Stagehand, discovers via Browserbase Search, fetches with Fetch API, falls back to browser sessions when needed, iterates strategy from traces, synthesizes a cited brief, and writes auditable workspace/output artifacts (plus optional FARA-style benchmarks).

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

Comment thread typescript/deep-research-agent/src/research.ts
Comment thread typescript/deep-research-agent/index.ts Outdated
Copy link
Copy Markdown
Author

bugbot run verbose=true

@cursor
Copy link
Copy Markdown

cursor Bot commented May 7, 2026

Bugbot request id: serverGenReqId_99a1e2b6-44c5-4517-8468-61436b1da0dc

Comment thread typescript/deep-research-agent/package.json Outdated
Comment thread typescript/deep-research-agent/src/research.ts Outdated
Comment thread typescript/deep-research-agent/index.ts Outdated
Comment thread typescript/deep-research-agent/src/api-utils.ts Outdated
Comment thread typescript/deep-research-agent/public/index.html
Comment thread typescript/deep-research-agent/src/local-web.ts
Comment thread typescript/deep-research-agent/src/research.ts Outdated
Comment thread typescript/deep-research-agent/src/research.ts
Comment thread typescript/deep-research-agent/src/api-utils.ts
@shriyatheunicorn shriyatheunicorn force-pushed the add-deep-research-agent-template branch from fba2b10 to c7da4fe Compare May 12, 2026 18:48
@shriyatheunicorn shriyatheunicorn changed the title Add deep research agent template Update deep research agent template dashboard May 14, 2026
@shriyatheunicorn shriyatheunicorn marked this pull request as draft May 14, 2026 23:18
Comment thread typescript/deep-research-agent/public/index.html
Comment thread typescript/deep-research-agent/src/research.ts Outdated
Comment thread typescript/deep-research-agent/public/index.html
Comment thread typescript/deep-research-agent/public/index.html Outdated
Comment thread typescript/deep-research-agent/public/index.html Outdated
Comment thread typescript/deep-research-agent/src/api-utils.ts Outdated
Comment thread typescript/deep-research-agent/src/research.ts Outdated
Comment thread typescript/deep-research-agent/src/research.ts
Comment thread typescript/deep-research-agent/src/research.ts Outdated
Comment thread typescript/deep-research-agent/public/index.html Outdated
Co-authored-by: shriyatheunicorn <shriavj@gmail.com>
@shriyatheunicorn shriyatheunicorn marked this pull request as ready for review May 15, 2026 18:23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file is quite long and would be very hard for a beginner to follow or understand what's going on. Is there any way we can split this up into separate files?

Comment thread typescript/deep-research-agent/src/api-utils.ts
Comment thread typescript/deep-research-agent/src/research.ts
Comment thread typescript/deep-research-agent/src/research.ts Outdated
`Research question: ${topic}`,
].join(" "),
ResearchReportSchema,
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Synthesis output not validated

Medium Severity

synthesizeReport returns the raw stagehand.extract result without ResearchReportSchema.parse, unlike planning, rubric, strategy, and verification steps. If extraction succeeds but omits required fields such as claimMap, later verifyReport and artifact rendering can throw and turn an otherwise completed run into a 500 response.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7022c0c. Configure here.

function errorMessage(error: unknown): string {
if (error instanceof Error) return error.message;
return String(error);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Duplicated errorMessage helper

Low Severity

The same errorMessage helper is implemented independently in research.ts and api-utils.ts. Identical logic in two modules increases the risk that one copy changes while the other does not, leading to inconsistent API and CLI error text.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7022c0c. Configure here.

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 2 potential issues.

There are 4 total unresolved issues (including 2 from previous reviews).

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 ec7f475. Configure here.

}
renderResults(payload);
setStatus("Ready", "ready");
setPipeline("complete");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verify step shows success on failure

Medium Severity

After a successful HTTP response, the dashboard always calls setPipeline("complete"), which marks every pipeline step—including Verify—as completed with success styling. When verification.pass is false, metrics and overview still show review/failure, so the timeline contradicts the verification outcome.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ec7f475. Configure here.

topic: task.question,
runId: task.id,
externalRubric: task.precomputedRubric,
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark init URL never used

Medium Severity

Benchmark loading stores init_url / website on each task, but runBenchmark only passes the question and rubric into runResearchTask. Tasks that expect research to start from a specific URL never get that URL in the pipeline.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ec7f475. 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.

3 participants