mirror of
https://github.com/open-webui/pipelines.git
synced 2026-11-05 01:37:24 +00:00
[PR #597] Preserve filter HTTPException and return 429 in the rate limit example #482
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/pipelines#482
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/pipelines/pull/597
Author: @sebnowak
Created: 3/16/2026
Status: 🔄 Open
Base:
main← Head:fix/preserve-filter-http-errors📝 Commits (1)
49c8d2fPreserve HTTPException in filter endpoints📊 Changes
2 files changed (+9 additions, -1 deletions)
View changed files
📝
examples/filters/rate_limit_filter_pipeline.py(+5 -1)📝
main.py(+4 -0)📄 Description
I ran into this while testing the rate-limit filter pipeline through Open WebUI.
Currently, the filter endpoints in
main.pywrap any exception as500. That means a filter cannot intentionally return something like429and expect the caller to receive that status.The rate-limit example also raises a plain
Exception, so even when it is enforcing the limit, the response looks like an internal error instead of a real rate-limit response.This patch keeps
HTTPExceptionintact in the filter endpoints and updates the rate-limit example to raiseHTTPException(status_code=429, ...).Scope of this PR:
500behavior for unexpected exceptions429instead of a generic errorI have a matching Open WebUI PR (https://github.com/open-webui/open-webui/pull/22726).
I have personally tested the changes. How I tested:
python3 test_pipelines_http_errors.py(test creation was supported by Codex)filter_inletpreserves a raisedHTTPException(429, ...)filter_outletpreserves a raisedHTTPException(429, ...)429on the blocked request instead of a generic exceptionCLI otuput:
TEST
test_pipelines_http_errors.py
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.