Skip to main content
r/OpenWebUI icon

r/OpenWebUI upvote upvote

We're hiring: https://careers.openwebui.com/

members
online

Backend Test Coverage Backend Test Coverage
Question/Help

Hey guys, I tried to debug a bug in OpenwebUI for the last day or two which lead to a "Waterfall" repetition of content when trying to connect my own Agent (which should be OpenAI compatible) as an OpenAI model. I verified that my SSE stream is correct and wanted to debug it in OpenwebUIs repo, but I got lost in the middleware of the backend.

I found it quite hard to comprehend with a lot of inner functions, factories, limited modularisation, limited doc string or in-code documentation. A static analysis reveals a significant gap between the size of the implementation and the existing test suite.

Key Metrics

  • Total Backend Lines of Code (Python): ~73,652

  • Total Test Lines of Code: ~1,747

  • Estimated Test-to-Code Ratio: ~2.4%

  • Total Test Files found: 7

Many critical modules have no dedicated unit or integration tests in the backend/open_webui/test directory:

Component LOC Status
open_webui/main.py 2,426 ❌ No Tests
open_webui/config.py 4,024 ❌ No Tests
open_webui/utils/middleware.py 3,758 ❌ No Tests
open_webui/retrieval/ ~6,500+ ❌ No Tests
open_webui/routers/ 21/25 files ❌ No Tests

Only a few specific areas have existing tests:

  • Auths: test_auths.py

  • Users: test_users.py

  • Models: test_models.py

  • Prompts: test_prompts.py

  • Storage: test_provider.py

  • Redis Utility: test_redis.py

Any advice on how to approach debugging this?

Any other testing strategy that I am not aware that you guys use to get a robust solution?

If not, do you think adding more unit tests and some refactoring to specifically these critical components could be something thats on the roadmap? Happy to help as well.


The everything app, for work. Get everyone working in a single platform designed to manage any type of work.

Trusted by 3 million+ teams, try ClickUp for free today!

Image The everything app, for work. Get everyone working in a single platform designed to manage any type of work.


🚀 Open WebUI v0.6.42: The Largest Release Since 0.6.19! (93 Entries, Resizable Sidebar, & Massive Speed Boosts) 🚀 Open WebUI v0.6.42: The Largest Release Since 0.6.19! (93 Entries, Resizable Sidebar, & Massive Speed Boosts)
ANNOUNCEMENT

v0.6.42 has been released. This is the second-largest update in the project's history by entry count. It addresses the community's most frequent request (sidebar customization) and introduces a new server-side architecture for handling large files. The update focuses heavily on scaling performance for large datasets and delivering highly requested interface improvements.

Here are the 10 most notable changes:

1. Resizable Sidebar The sidebar width is now fully adjustable on desktop (220px to 480px). Preferences are saved locally, so the layout persists between sessions.

2. Major Knowledge Base Performance Overhaul File management has moved to server-side pagination, loading 30 files at a time rather than the entire collection. This results in massive speed increases for large knowledge bases.

3. Native File Viewers Excel and CSV files now render as interactive, scrollable tables within the UI. Markdown files display with full typography, and source code files include syntax highlighting without needing to be downloaded.

4. Bulk Website & YouTube Import Users can now add multiple URLs at once (newline-separated). The system processes them sequentially and automatically retrieves transcripts for YouTube videos. ALSO FOR KNOWLEDGE BASES!!!!

5. Optimized Image Storage User-uploaded images are now converted from Base64 to actual file storage on the server. This eliminates large inline strings in the history and significantly reduces database bloat.

6. Full-Screen Chat Input When messages exceed two lines, an expand button now appears, allowing for a focused, full-screen editor experience for long-form prompting.

7. Notes Feature Redesign The Notes system now supports server-side search, filtering by author, and "Read Only" permissions for safer sharing.

8. Unlimited Web Search Concurrency The WEB_SEARCH_CONCURRENT_REQUESTS default has been changed to 0 (unlimited), applying to all search engines for faster parallel query execution. With the option to setting it to '1' to make it sequential for rate limited providers!

9. Read-Only Knowledge Access Users can now view and explore shared Knowledge Base collections without having write/delete permissions, improving collaboration security.

10. Critical Database Schema Changes This release modifies the database schema. Administrators running multi-worker or load-balanced deployments must update all instances simultaneously. Rolling updates will result in application failure.

https://github.com/open-webui/open-webui/releases/tag/v0.6.42