Skip to content

feat(search): wire web_search into orchestrator + modernize Exa API#127

Open
wackhacker-bot[bot] wants to merge 1 commit into
mainfrom
wack-hacker/wack-hacker-j12mwt
Open

feat(search): wire web_search into orchestrator + modernize Exa API#127
wackhacker-bot[bot] wants to merge 1 commit into
mainfrom
wack-hacker/wack-hacker-j12mwt

Conversation

@wackhacker-bot
Copy link
Copy Markdown
Contributor

@wackhacker-bot wackhacker-bot Bot commented May 2, 2026

The lockfile changes appear to be Bun re-resolving — exa-js going from missing → installed at 1.10.3 (matching ^1.4.4) and pulling its transitive deps (cross-fetch, openai, etc.). This is expected since the dep was declared but apparently not previously locked. I'll keep these changes since they're necessary for the runtime.

Actually wait, exa-js was already in package.json before my changes (per the original prompt). So the lockfile must have been out-of-sync on main. The bun install resolved it properly. I'll leave these changes.

All checks pass. Let me do a final summary.

Summary

Wired the existing web_search tool into the orchestrator and modernized it to take advantage of Exa SDK options (the installed exa-js resolved to 1.10.3 against the ^1.4.4 range). The tool now accepts category, livecrawl, excludeDomains, includeText, excludeText, requests summary: { query } for token-efficient previews while keeping highlights as a fallback, and includes the author in the formatted output. Also fixed a pre-existing typecheck error in src/lib/ai/constants.ts (line 77) where unescaped backticks inside the SYSTEM_PROMPT template literal broke parsing — escaping them was necessary for typecheck to pass on this branch. Added unit tests at src/lib/ai/tools/search/index.test.ts mocking the exa-js default export class, and updated BASE_TOOLS in orchestrator.test.ts to include web_search. Verified with bun run typecheck, bun run lint, bun run test, bun run format — all green.

Test Plan

  • bun run typecheck — passes (after escaping backticks on the pre-existing prompt line).
  • bun run lint — passes.
  • bun run test — passes; new file src/lib/ai/tools/search/index.test.ts covers: formatted success output (title/url/summary/author/highlights fallback), empty results returning "No results found.", SDK error returning "Web search failed: …", and forwarding of category + livecrawl (plus include/exclude domains/text and summary: { query }) to searchAndContents.
  • bun run format — passes.

Generated by @rayhanadev using Wack Hacker

@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wack-hacker Error Error May 2, 2026 9:26pm

Request Review

@sentry
Copy link
Copy Markdown

sentry Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.05%. Comparing base (91987df) to head (ee1d1e5).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #127   +/-   ##
=======================================
  Coverage   99.05%   99.05%           
=======================================
  Files          62       62           
  Lines        1486     1486           
  Branches      350      350           
=======================================
  Hits         1472     1472           
  Misses          9        9           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

0 participants