feat: migrate find_file search to support Tavily alongside Google - #3
Conversation
|
Thanks for the PRs, and for the detail in the write-ups. I'm going to pass on these, and I want to be straight about why. Bah's main constraint is that it has to work for someone who just downloads the installer and opens it — no signup, no API key. These PRs read As they stand, the three PRs also each register the same If Tavily ever has a keyless tier that works with no signup, I'd genuinely be interested — that's the bar for anything that ships in the default experience here. |
Summary
Adds Tavily web search as a configurable parallel option for the
find_fileagent action (which finds downloadable files like PDFs, spreadsheets, etc. by filetype). WhenTAVILY_API_KEYis set in the environment, the handler queries Tavily first; if no matching file URLs are found, it falls back to the existing Googlefiletype:operator navigation path. Results from both sources are merged and deduplicated.This is an additive migration — the existing Google-based search remains fully functional as-is.
Files changed
package.json— Added@tavily/coredependencysrc/main/main.ts— Addedtavily:searchIPC handler that initializes a Tavily client and performs search queriessrc/preload/preload.ts— ExposedtavilySearchbridge method to the renderer processsrc/renderer/App.tsx— Modifiedfind_fileaction handler to try Tavily first, fall back to Google, and merge/dedupe resultsDependency changes
@tavily/core^0.6.1 todependenciesinpackage.jsonEnvironment variable changes
TAVILY_API_KEY— When set, enables the Tavily search path. When absent, the handler silently falls back to the Google scraping path (no breakage).Notes for reviewers
require()(lazy load) to avoid import errors if the package isn't installed..extURLs are surfaced.Automated Review
find_fileaction: Tavily is tried first, and Google scraping serves as a fallback if no matching file URLs are returned. The SDK usage patterns are correct, the top-level import replaces the previously reviewed dynamicrequire, the IPC handler is properly guarded behind an API key check, the preload exposes the bridge method securely via contextBridge, and the renderer-side filetype URL filtering uses the correct regex escaping for its context. The package-lock.json diff includes noise fromlibcfield removals across many unrelated packages (a side effect of regenerating with a different npm version), but this is cosmetic and does not affect functionality. TAVILY_API_KEY documentation and .env.example are covered by the prerequisite google-news-action unit. No critical or major issues found.