mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-24 11:58:31 -05:00
[PR #20255] [MERGED] fix: retry Brave Search on HTTP 429 rate limit with 1s delay #41150
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/20255
Author: @Classic298
Created: 12/30/2025
Status: ✅ Merged
Merged: 12/30/2025
Merged by: @tjbck
Base:
dev← Head:brave📝 Commits (2)
d9dc613Update brave.pya48f560Update brave.py📊 Changes
1 file changed (+9 additions, -0 deletions)
View changed files
📝
backend/open_webui/retrieval/web/brave.py(+9 -0)📄 Description
Summary
Adds automatic retry logic to the Brave Search integration when a 429 (Too Many Requests) response is received. This addresses the issue where Brave's free tier enforces a strict 1 request per second limit that can be hit even when concurrent requests is set to 1.
Problem
Setting WEB_SEARCH_CONCURRENT_REQUESTS to 1 prevents parallel requests, but does not add any delay between sequential requests. If your internet connection is fast enough, back-to-back requests can still exceed Brave's 1 request/second limit, resulting in 429 errors.
Solution
When the Brave API returns HTTP 429, the code now:
This is a minimal, targeted fix that only affects Brave Search and respects the documented API rate limit without requiring additional configuration.
Related Issues
Fixes #15134
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.