Add deep research agent template#89
Conversation
| 0, | ||
| 100, | ||
| ); | ||
| const citationPenalty = Math.min(unsupportedClaims.length * 12 + weakCitations.length * 8, 60); |
There was a problem hiding this comment.
Deterministic verification double-counts citation penalty
Medium Severity
weakCitations is derived as a direct 1:1 copy of unsupportedClaims (line 1651–1655), so both arrays always have the same length. The citationPenalty formula on line 1669 adds unsupportedClaims.length * 12 + weakCitations.length * 8, which effectively becomes unsupportedClaims.length * 20 — double-counting the same claims. This inflates the penalty and deflates outcomeScore, making the deterministic verification systematically more pessimistic than intended. For example, 3 unsupported claims yield a penalty of 60 instead of 36, which can flip pass from true to false. This path runs whenever USE_VERIFIER=false or the model-based verifier throws.
Reviewed by Cursor Bugbot for commit d66d9f5. Configure here.
| markdown: result.paths.markdownPath, | ||
| json: result.paths.jsonPath, | ||
| }, | ||
| }; |
There was a problem hiding this comment.
Response mapping duplicated across three handler files
Low Severity
The entire response-building block — runResearchTask call, latestQuality extraction, sources mapping with score.toFixed(3), and artifacts assembly — is copy-pasted identically across api/research.ts, index.ts, and src/local-web.ts. Any future change to the response shape (e.g., adding a field or adjusting rounding) must be replicated in three places, which increases the risk of inconsistencies.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit d66d9f5. Configure here.
| function errorMessage(error: unknown): string { | ||
| if (error instanceof Error) return error.message; | ||
| return String(error); | ||
| } |
There was a problem hiding this comment.
Helpers duplicated verbatim across four entry-point files
Low Severity
readTopic, cleanTopic, and errorMessage are copy-pasted across api/research.ts, index.ts, src/local-web.ts, and src/research.ts (four copies of errorMessage, three of the others). A shared utility module would eliminate this duplication and reduce the risk of the copies drifting apart during future maintenance.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 755daac. Configure here.
|
bugbot run |
|
bugbot run verbose=true |
|
Bugbot request id: serverGenReqId_12620f78-ff50-4152-ac4d-fdcae4423818 |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
3 issues from previous reviews remain unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 755daac. Configure here.


Summary
typescript/deep-research-agenttemplate for bb research engineVerification
npm run checkNote
Medium Risk
Adds a large new TypeScript template that runs live-web research via Browserbase Search/Fetch plus Stagehand browser fallback, including CLI, local web server, and Vercel endpoints; risk is mainly around new networked/LLM-driven logic and runtime/config edge cases rather than changes to existing templates.
Overview
Introduces a new
typescript/deep-research-agenttemplate that turns a topic into an auditable, cited research brief by combining Browserbasesearch+fetchwith Stagehand browser-session fallback, then optional synthesis and verification passes.Adds multiple execution surfaces: a CLI/benchmark runner (
src/research.ts), a local dashboard server (src/local-web.ts+public/index.html), and Vercel handlers (index.ts,api/health.ts,api/research.ts+vercel.json) that expose/healthand/researchAPIs and return report/verification/sources plus artifact paths.Updates the repo
README.mdtemplate table to include the new template, and ships supporting template assets (package.json,.env.example,.gitignore, andbenchmark.example.tsv).Reviewed by Cursor Bugbot for commit 755daac. Bugbot is set up for automated code reviews on this repo. Configure here.