The built-in search_web tool was ignoring the admin WEB_SEARCH_RESULT_COUNT setting because it had a hardcoded count=5 default and then re-truncated results.
The backend _search_web() function correctly uses WEB_SEARCH_RESULT_COUNT from admin settings, but search_web() in builtin.py was silently discarding extra results.
Fix
Removed the count parameter from search_web() function signature
Removed the secondary results[:count] truncation
The backend already respects the admin setting, so no additional limiting is needed
Testing
Syntax validation via ast.parse() - OK
No other code references the count parameter
Impact
Users who set WEB_SEARCH_RESULT_COUNT=10 will now get 10 results instead of 5
No breaking changes - the tool still returns JSON search results
Only affects Native Function Calling mode (built-in tools)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/21383
**Author:** [@goncaloalves](https://github.com/goncaloalves)
**Created:** 2/13/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix-web-search-result-count`
---
### 📝 Commits (1)
- [`7b4fa58`](https://github.com/open-webui/open-webui/commit/7b4fa5843ffc4ceb595fbf0ad1df7726c063cb40) fix: respect WEB_SEARCH_RESULT_COUNT in native search_web tool
### 📊 Changes
**1 file changed** (+0 additions, -5 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/tools/builtin.py` (+0 -5)
</details>
### 📄 Description
## Summary
Fixes #21371
The built-in `search_web` tool was ignoring the admin `WEB_SEARCH_RESULT_COUNT` setting because it had a hardcoded `count=5` default and then re-truncated results.
## Root Cause
```python
async def search_web(
query: str,
count: int = 5, # ← hardcoded default, ignores admin setting
...
) -> str:
...
results = results[:count] # ← re-truncates to 5
```
The backend `_search_web()` function correctly uses `WEB_SEARCH_RESULT_COUNT` from admin settings, but `search_web()` in `builtin.py` was silently discarding extra results.
## Fix
- Removed the `count` parameter from `search_web()` function signature
- Removed the secondary `results[:count]` truncation
- The backend already respects the admin setting, so no additional limiting is needed
## Testing
- [x] Syntax validation via `ast.parse()` - OK
- [x] No other code references the `count` parameter
## Impact
- Users who set `WEB_SEARCH_RESULT_COUNT=10` will now get 10 results instead of 5
- No breaking changes - the tool still returns JSON search results
- Only affects Native Function Calling mode (built-in tools)
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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.