馃攳 feat: add Tavily as Search and Scraper Provider - #12581
Conversation
|
/gitnexus index |
|
@codex review |
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90f626231e
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -903,11 +903,13 @@ export enum SearchCategories { | |||
| export enum SearchProviders { | |||
| SERPER = 'serper', | |||
| SEARXNG = 'searxng', | |||
| TAVILY = 'tavily', | |||
There was a problem hiding this comment.
Remove unsupported Tavily search provider from enum
This adds tavily as a valid searchProvider, but the pinned runtime dependency (@librechat/agents 3.1.64 in package-lock.json) does not support it: createSearchAPI only accepts serper/searxng and throws for other values. In practice, a config using webSearch.searchProvider: tavily will pass auth selection here and then fail to construct the web_search tool at runtime.
Useful? React with 馃憤聽/ 馃憥.
There was a problem hiding this comment.
Audited after rebasing this PR onto origin/dev and pushing a730b88e6. The runtime support for searchProvider: tavily lives in the paired agents PR (danny-avila/agents#85), so this remains a cross-repo dependency until that agents change is mergeable/published and LibreChat can bump @librechat/agents to the published version. I also updated the LibreChat Tavily option schema in a730b88e6 to match the Tavily API string modes, but I鈥檓 leaving this thread unresolved until the agents package bump is available.
There was a problem hiding this comment.
Update: the original agents PR could not be updated because maintainer pushes to the contributor fork were rejected with HTTP 403, so I opened the rebased maintainer-owned replacement as danny-avila/agents#135 and closed danny-avila/agents#85. This LibreChat thread remains the same dependency issue, now tracking agents runtime support via #135.
| } | ||
|
|
||
| export enum ScraperProviders { | ||
| FIRECRAWL = 'firecrawl', | ||
| SERPER = 'serper', | ||
| TAVILY = 'tavily', |
There was a problem hiding this comment.
Do not expose Tavily scraper before runtime support
Adding tavily to scraperProvider is currently broken with the pinned agents package: createSearchTool only has a serper branch and otherwise falls back to Firecrawl. So scraperProvider: tavily can authenticate via tavilyApiKey in this repo, but scraping actually runs through Firecrawl and requires FIRECRAWL_API_KEY, causing Tavily-only setups to fail when extraction is attempted.
Useful? React with 馃憤聽/ 馃憥.
There was a problem hiding this comment.
Audited after rebasing this PR onto origin/dev and pushing a730b88e6. The Tavily scraper runtime support is implemented in the paired agents PR (danny-avila/agents#85), so this is still blocked on getting that agents branch pushed/merged/published and then bumping @librechat/agents here. The LibreChat branch now accepts the Tavily option modes, but this thread should stay unresolved until the runtime package dependency is available.
There was a problem hiding this comment.
Update: the original agents PR could not be updated because maintainer pushes to the contributor fork were rejected with HTTP 403, so I opened the rebased maintainer-owned replacement as danny-avila/agents#135 and closed danny-avila/agents#85. This thread is still valid until #135 is merged/published and LibreChat bumps @librechat/agents.
deb0dc1 to
a730b88
Compare
|
@codex review |
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a730b88e6b
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -927,11 +927,13 @@ export enum SearchCategories { | |||
| export enum SearchProviders { | |||
| SERPER = 'serper', | |||
| SEARXNG = 'searxng', | |||
| TAVILY = 'tavily', | |||
There was a problem hiding this comment.
Align exported search provider type with Tavily support
Adding SearchProviders.TAVILY here makes 'tavily' valid in parsed config, but the exported SearchProvider union in packages/data-provider/src/types/web.ts still only allows 'serper' | 'searxng'. Any TypeScript consumer using SearchConfig now gets a type mismatch when configuring Tavily, which breaks type-safe adoption of the new provider unless callers cast away types.
Useful? React with 馃憤聽/ 馃憥.
| # # excludeDomains: # Exclude specific domains from results (max 150) | ||
| # # - 'spam.com' | ||
| # # timeRange: week # 'day', 'week', 'month', or 'year' | ||
| # # timeout: 15000 # HTTP request timeout in milliseconds |
There was a problem hiding this comment.
Use Tavily timeout examples in seconds, not milliseconds
This example documents Tavily timeout as milliseconds (15000), but Tavily's Search/Extract timeout parameters are second-based and constrained to small ranges. Users copying this value will configure an out-of-range timeout and can trigger request validation failures. The sample should show second-based values (for example 15) and correct units in the comment.
Useful? React with 馃憤聽/ 馃憥.
a730b88 to
0f37f92
Compare
|
@codex review |
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f37f925a0
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| webSearchConfig?.scraperTimeout ?? webSearchConfig?.firecrawlOptions?.timeout ?? 7500; | ||
| webSearchConfig?.scraperTimeout ?? | ||
| webSearchConfig?.firecrawlOptions?.timeout ?? | ||
| webSearchConfig?.tavilyScraperOptions?.timeout ?? |
There was a problem hiding this comment.
Scope Tavily timeout to Tavily scraper only
tavilyScraperOptions.timeout is now part of the global scraperTimeout fallback chain, so a Tavily-specific setting can change timeout behavior even when the active scraper is firecrawl or serper. This is a behavior regression when users keep multi-provider config blocks and only switch scraperProvider: with scraperProvider: firecrawl and no explicit scraperTimeout, the Firecrawl path will inherit Tavily鈥檚 timeout unintentionally. Apply this fallback only when scraperProvider is Tavily (or require explicit scraperTimeout for cross-provider behavior).
Useful? React with 馃憤聽/ 馃憥.
There was a problem hiding this comment.
Fixed in 1d47e5f36. tavilyScraperOptions.timeout now feeds the shared scraper timeout only when scraperProvider is Tavily, so Firecrawl and Serper no longer inherit Tavily-specific timeout settings from multi-provider config blocks. Added API web auth regression tests for both the Firecrawl and Tavily timeout paths. Local verification: npx jest src/web/web.spec.ts --runInBand.
|
@codex review |
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d47e5f361
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -245,10 +247,23 @@ export async function loadWebSearchAuth({ | |||
| authTypes.push([category, isUserProvided ? AuthType.USER_PROVIDED : AuthType.SYSTEM_DEFINED]); | |||
| } | |||
|
|
|||
| const scraperProvider = webSearchConfig?.scraperProvider ?? 'firecrawl'; | |||
There was a problem hiding this comment.
Base scraper timeout on resolved scraper provider
Use the authenticated scraper in authResult.scraperProvider when choosing provider-specific timeout options. As written, if scraperProvider is omitted in config and only Tavily credentials are available, checkAuth resolves the scraper to Tavily, but this branch still defaults to 'firecrawl' and ignores tavilyScraperOptions.timeout, falling back to 7500. That causes unexpected timeout behavior for valid Tavily-only setups and can prematurely fail extractions.
Useful? React with 馃憤聽/ 馃憥.
There was a problem hiding this comment.
Fixed in 580a2ae08. Timeout selection now uses the resolved authResult.scraperProvider first, then falls back to the raw config/default, so Tavily-only authenticated setups get their tavilyScraperOptions.timeout even when scraperProvider is omitted. Local verification: npx jest src/web/web.spec.ts --runInBand.
|
@codex review |
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 580a2ae080
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -927,11 +927,13 @@ export enum SearchCategories { | |||
| export enum SearchProviders { | |||
| SERPER = 'serper', | |||
| SEARXNG = 'searxng', | |||
| TAVILY = 'tavily', | |||
There was a problem hiding this comment.
Keep search-provider types consistent with Tavily support
Adding TAVILY to the runtime SearchProviders enum here without also widening the legacy SearchProvider literal type in packages/data-provider/src/types/web.ts ('serper' | 'searxng') leaves exported types inconsistent. TypeScript consumers that use SearchConfig/SearchProvider will still reject searchProvider: 'tavily', so adopting the new provider now requires unsafe casts or fails compilation.
Useful? React with 馃憤聽/ 馃憥.
There was a problem hiding this comment.
Fixed in 3b10eb907. The legacy SearchProvider type now includes tavily, and SearchConfig includes the Tavily search key/url/options fields so TypeScript consumers can use Tavily without casts. Local verification: npx jest src/config.spec.ts --runInBand and npx tsc --noEmit in packages/data-provider.
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 鈩癸笍 About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 馃憤. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
3b10eb9 to
9f5cdfd
Compare
|
@codex review |
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f5cdfd4c6
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -7,6 +7,9 @@ export type TWebSearchKeys = | |||
| | 'firecrawlApiKey' | |||
| | 'firecrawlApiUrl' | |||
| | 'firecrawlVersion' | |||
| | 'tavilyApiKey' | |||
There was a problem hiding this comment.
Prevent web_search uninstall from deleting Tavily tool auth
Adding tavilyApiKey to webSearchKeys causes web_search uninstall to always target TAVILY_API_KEY, and in updateUserPluginsController that key is deleted via deleteUserPluginAuth(userId, authField) without a plugin scope; deletePluginAuth then deletes by { userId, authField } only. In practice, users who configured the separate tavily_search_results_json tool (which also uses TAVILY_API_KEY) will lose that credential when uninstalling web_search, even though they did not uninstall the Tavily tool.
Useful? React with 馃憤聽/ 馃憥.
|
@codex review |
|
Codex Review: Didn't find any major issues. 馃殌 鈩癸笍 About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 馃憤. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
0eaf3c5 to
d90e36a
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 鈩癸笍 About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 馃憤. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
d90e36a to
43f4298
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 鈩癸笍 About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 馃憤. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* feat: add Tavily integration as search provider and scraper provider * chore:update tavily web search parameters * chore:tavily paramer update * chore:update data-schemas test for tavily * fix: allow Tavily string option modes * fix: align Tavily config options * fix: scope Tavily scraper timeout * fix: use resolved scraper provider timeout * fix: widen Tavily search provider types * fix: harden Tavily web search config * fix: cap Tavily option timeouts --------- Co-authored-by: Danny Avila <danny@librechat.ai>
* feat: add Tavily integration as search provider and scraper provider * chore:update tavily web search parameters * chore:tavily paramer update * chore:update data-schemas test for tavily * fix: allow Tavily string option modes * fix: align Tavily config options * fix: scope Tavily scraper timeout * fix: use resolved scraper provider timeout * fix: widen Tavily search provider types * fix: harden Tavily web search config * fix: cap Tavily option timeouts --------- Co-authored-by: Danny Avila <danny@librechat.ai>
* feat: add Tavily integration as search provider and scraper provider * chore:update tavily web search parameters * chore:tavily paramer update * chore:update data-schemas test for tavily * fix: allow Tavily string option modes * fix: align Tavily config options * fix: scope Tavily scraper timeout * fix: use resolved scraper provider timeout * fix: widen Tavily search provider types * fix: harden Tavily web search config * fix: cap Tavily option timeouts --------- Co-authored-by: Danny Avila <danny@librechat.ai>
Pull Request Template
Summary
tavilySearchOptionsandtavilyScraperOptionsconfig blocks for full control over Tavily Search and Extract API parametersChange Type
Please delete any irrelevant options.
Checklist
Please delete any irrelevant options.