[PR #21525] fix: make Brave web search failures clearer and safer #49170

Open
opened 2026-04-30 01:29:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21525
Author: @Plutarch01
Created: 2/17/2026
Status: 🔄 Open

Base: devHead: fix/brave-web-search-resilience-dev


📝 Commits (1)

  • 1af8e0c fix: improve brave web search failure handling

📊 Changes

2 files changed (+25 additions, -1 deletions)

View changed files

📝 backend/open_webui/routers/retrieval.py (+9 -0)
📝 backend/open_webui/utils/middleware.py (+16 -1)

📄 Description

Pull Request Checklist

  • Target branch: Verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request down below.
  • Changelog: Ensure a changelog entry following Keep a Changelog format is added at the bottom of the PR description.
  • Documentation: Add docs in the Open WebUI Docs repository.
  • Dependencies: No new dependencies were added.
  • Testing: Performed manual and direct verification steps (listed below).
  • Agentic AI Code: Changes were reviewed and validated by a human with explicit testing before submission.
  • Code review: Performed self-review and ensured consistency with existing patterns.
  • Design & Architecture: Change uses safe defaults without introducing new settings.
  • Git Hygiene: PR is atomic and contains one logical fix commit.
  • Title Prefix: fix.

Changelog Entry

Description

  • Improve Brave web search resiliency and error transparency when query expansion is enabled.

Added

  • A Brave-specific fallback to sequential web-search execution when concurrency is unset/unlimited.
  • Clear error details in web-search status events and a system hint to prevent fabricated "technical difficulties" claims.

Changed

  • Preserve explicit admin-configured concurrency for all engines; only apply fallback for Brave with unset/unlimited concurrency.

Deprecated

  • None.

Removed

  • None.

Fixed

  • Reduced likelihood of Brave free-tier 429 bursts from parallel generated queries.
  • Improved observability of web-search failures shown to users.

Security

  • None.

Breaking Changes

  • None.

Additional Information

  • Files changed:
    • backend/open_webui/routers/retrieval.py
    • backend/open_webui/utils/middleware.py

How I tested

  1. Compiled changed backend files with:
    • python -m py_compile open_webui/routers/retrieval.py open_webui/utils/middleware.py
  2. Verified fallback logic only applies when:
    • engine is brave
    • WEB_SEARCH_CONCURRENT_REQUESTS is unset/0
  3. Verified explicit non-zero concurrency remains unchanged.
  4. Verified web-search failure status now includes specific exception detail.

Screenshots or Videos

  • Not applicable (backend-only behavior change).

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 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/21525 **Author:** [@Plutarch01](https://github.com/Plutarch01) **Created:** 2/17/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/brave-web-search-resilience-dev` --- ### 📝 Commits (1) - [`1af8e0c`](https://github.com/open-webui/open-webui/commit/1af8e0c3c7d6ae4522d16c195ad792d51b880d3b) fix: improve brave web search failure handling ### 📊 Changes **2 files changed** (+25 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/retrieval.py` (+9 -0) 📝 `backend/open_webui/utils/middleware.py` (+16 -1) </details> ### 📄 Description # Pull Request Checklist - [x] **Target branch:** Verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request down below. - [ ] **Changelog:** Ensure a changelog entry following Keep a Changelog format is added at the bottom of the PR description. - [ ] **Documentation:** Add docs in the Open WebUI Docs repository. - [x] **Dependencies:** No new dependencies were added. - [x] **Testing:** Performed manual and direct verification steps (listed below). - [x] **Agentic AI Code:** Changes were reviewed and validated by a human with explicit testing before submission. - [x] **Code review:** Performed self-review and ensured consistency with existing patterns. - [x] **Design & Architecture:** Change uses safe defaults without introducing new settings. - [x] **Git Hygiene:** PR is atomic and contains one logical fix commit. - [x] **Title Prefix:** `fix`. # Changelog Entry ### Description - Improve Brave web search resiliency and error transparency when query expansion is enabled. ### Added - A Brave-specific fallback to sequential web-search execution when concurrency is unset/unlimited. - Clear error details in web-search status events and a system hint to prevent fabricated "technical difficulties" claims. ### Changed - Preserve explicit admin-configured concurrency for all engines; only apply fallback for Brave with unset/unlimited concurrency. ### Deprecated - None. ### Removed - None. ### Fixed - Reduced likelihood of Brave free-tier 429 bursts from parallel generated queries. - Improved observability of web-search failures shown to users. ### Security - None. ### Breaking Changes - None. --- ### Additional Information - Files changed: - `backend/open_webui/routers/retrieval.py` - `backend/open_webui/utils/middleware.py` ### How I tested 1. Compiled changed backend files with: - `python -m py_compile open_webui/routers/retrieval.py open_webui/utils/middleware.py` 2. Verified fallback logic only applies when: - engine is `brave` - `WEB_SEARCH_CONCURRENT_REQUESTS` is unset/0 3. Verified explicit non-zero concurrency remains unchanged. 4. Verified web-search failure status now includes specific exception detail. ### Screenshots or Videos - Not applicable (backend-only behavior change). ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 01:29:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#49170