mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #21383] [CLOSED] fix: respect WEB_SEARCH_RESULT_COUNT in native search_web tool #49108
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21383
Author: @goncaloalves
Created: 2/13/2026
Status: ❌ Closed
Base:
main← Head:fix-web-search-result-count📝 Commits (1)
7b4fa58fix: respect WEB_SEARCH_RESULT_COUNT in native search_web tool📊 Changes
1 file changed (+0 additions, -5 deletions)
View changed files
📝
backend/open_webui/tools/builtin.py(+0 -5)📄 Description
Summary
Fixes #21371
The built-in
search_webtool was ignoring the adminWEB_SEARCH_RESULT_COUNTsetting because it had a hardcodedcount=5default and then re-truncated results.Root Cause
The backend
_search_web()function correctly usesWEB_SEARCH_RESULT_COUNTfrom admin settings, butsearch_web()inbuiltin.pywas silently discarding extra results.Fix
countparameter fromsearch_web()function signatureresults[:count]truncationTesting
ast.parse()- OKcountparameterImpact
WEB_SEARCH_RESULT_COUNT=10will now get 10 results instead of 5🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.