Skip to content

Add deep research agent template#89

Closed
shriyatheunicorn wants to merge 2 commits intodevfrom
codex/add-deep-research-agent-template
Closed

Add deep research agent template#89
shriyatheunicorn wants to merge 2 commits intodevfrom
codex/add-deep-research-agent-template

Conversation

@shriyatheunicorn
Copy link
Copy Markdown

@shriyatheunicorn shriyatheunicorn commented May 6, 2026

Summary

  • Add a new typescript/deep-research-agent template for bb research engine
  • Include CLI, local dashboard server, Vercel API handlers, environment example, and README
  • Adjust the dashboard API fallback for local template usage instead of the previous hosted app URL

Verification

  • npm run check
  • Parsed the inline dashboard script with Node

Note

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-agent template that turns a topic into an auditable, cited research brief by combining Browserbase search + fetch with 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 /health and /research APIs and return report/verification/sources plus artifact paths.

Updates the repo README.md template table to include the new template, and ships supporting template assets (package.json, .env.example, .gitignore, and benchmark.example.tsv).

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

0,
100,
);
const citationPenalty = Math.min(unsupportedClaims.length * 12 + weakCitations.length * 8, 60);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d66d9f5. Configure here.

markdown: result.paths.markdownPath,
json: result.paths.jsonPath,
},
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 755daac. Configure here.

Copy link
Copy Markdown
Author

bugbot run

Copy link
Copy Markdown
Author

bugbot run verbose=true

@cursor
Copy link
Copy Markdown

cursor Bot commented May 6, 2026

Bugbot request id: serverGenReqId_12620f78-ff50-4152-ac4d-fdcae4423818

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.

✅ Bugbot reviewed your changes and found no new issues!

3 issues from previous reviews remain unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 755daac. Configure here.

@shriyatheunicorn shriyatheunicorn deleted the codex/add-deep-research-agent-template branch May 6, 2026 23:58
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.

1 participant