mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-24 14:23:59 -05:00
[PR #24619] [CLOSED] fix: post-merge missing-await regressions and Pinecone namespace correctness #115054
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24619
Author: @PVBLIC-F
Created: 5/12/2026
Status: ❌ Closed
Base:
main← Head:fix/post-merge-await-and-namespaces📝 Commits (10+)
1adcd55fix: correct indentation in query retry loopa219c22feat: increase citation modal size for better video displayd7c1db6feat: comprehensive stopword filtering for topic extraction9776b2afeat: filter headers, footers, and OCR noise from PDF/text extraction34a42fafix: remove OCR artifacts and noise from within text chunks959894ffeat: upgrade cleaning level to 'standard' for better text quality1b3dae3feat: upgrade to hi_res strategy for superior PDF element classification37e7029feat: enhanced artifact removal for trailing noise and truncated text4a85722Fix video file cross-pollination in knowledge base collections63b49d8Fix collection overwriting issue when uploading multiple files simultaneously📊 Changes
147 files changed (+32484 additions, -1266 deletions)
View changed files
➕
.cursorrules(+1162 -0)📝
.github/workflows/build-release.disabled(+0 -0)📝
.github/workflows/docker-build.disabled(+0 -0)📝
.github/workflows/release-pypi.disabled(+0 -0)📝
.gitignore(+8 -0)📝
CHANGELOG.md(+27 -0)➕
CODE_REVIEW_KNOWLEDGE_CLEANUP.md(+349 -0)➕
CODE_REVIEW_VIDEO_STREAMING.md(+402 -0)➕
CURSORRULES_REVIEW.md(+363 -0)📝
Dockerfile(+3 -0)➕
FEATURE_OVERVIEW_JSONB_OPTIMIZATIONS.md(+960 -0)➕
NAMESPACE_FLOW_VERIFICATION.md(+298 -0)➕
NAMESPACE_IMPLEMENTATION_REVIEW.md(+567 -0)➕
PG17_PERFORMANCE_OPTIMIZATIONS.md(+576 -0)➕
PHASE_5_6_REVIEW.md(+422 -0)➕
PINECONE_NAMESPACE_ISOLATION.md(+198 -0)➕
PINECONE_REFACTOR_SUMMARY.md(+141 -0)➕
VIDEO_STREAMING_OPTIMIZATION.md(+337 -0)📝
backend/open_webui/config.py(+570 -39)📝
backend/open_webui/env.py(+26 -3)...and 80 more files
📄 Description
Summary
PR #1 of the post-v0.9.5 codebase review. Each change addresses a real
runtime bug or silently-broken code path that surfaced after the
upstream sync→async migration. All edits are mechanical — no behavior
choices that need product input. Tier 1 (spend ledger, enforcement
gaps) and Tier 2 (storage cache, loaders, migration safety) are
follow-up PRs.
Tier 0 — fixed in this PR
Missing
awaiton async APIsutils/task.py+routers/tasks.py—chapter_generation_templatewas sync but called the now-async
prompt_templatewithoutawait,so the LLM received a coroutine
reprinterpolated into the promptstring. Wrapper made async;
awaitadded at definition and call site.routers/audio.py(get_audio_segment,get_video_segment),routers/tasks.py(generate_chapters) —Files.get_file_by_idis async post-merge; the sync calls returned coroutines that bypassed
the existence guard and crashed on
.user_id.utils/gmail_sender.py— same missing-awaitpattern onOAuthSessions.get_session_by_provider_and_user_idas thegoogle_drive_client.pyfix in1cbfa1be0.utils/knowledge_drive_sync.py— two missed awaits onKnowledges.get_knowledge_by_idandadd_file_to_knowledge_by_id.The latter meant Drive files uploaded to storage were silently never
linked into the target KB.
Pinecone namespace correctness
get_namespace_for_collection(in bothretrieval/utils.pyandrouters/retrieval.py) — the helper made a sync call to the now-asyncKnowledges.get_knowledge_by_id; the swallowedAttributeErroron.namemeant the documented"{name}-{id}"prefix was never produced.Dropped the lookup (matching what's actually been written to Pinecone
since the merge) and added a
parent_collection_nameparameter soexisting call sites in
routers/knowledge.pystop raising theswallowed
TypeErrorthat was leaving file-level namespaces orphanedon KB delete/reset.
pinecone.pysearch()— callerfilterwas silently dropped.Now safe-merges (mirror of
query()).pinecone.pydelete()—dict.update(filter)allowed acaller-supplied
collection_nameto overwrite the enforced prefix.Now safe-merges.
async_client.py— every method now accepts and forwards anamespacekwarg. Without this,VectorSearchRetriever(hybrid path)and the admin vector-delete endpoint always
TypeErrord.Gmail data-deletion targeting
routers/gmail.pydelete_gmail_dataand the force-full-syncbranch in
utils/gmail_auto_sync.py— both were callingVECTOR_DB_CLIENT.deletewith collection/namespace tuples that didnot match what
SimplePineconeManager.schedule_upsertactuallywrites. Aligned to the indexer's real layout (
collection="gmail"+namespace="email-{user_id}"for Pinecone,collection="email-{user_id}"for namespace-agnostic backends). "Delete my Gmail data" now actually
deletes vectors.
Form schema fix
routers/retrieval.pyQueryDocForm— added thehybrid_bm25_weightfield the handler was already reading, anddropped the unsupported
user=userkwarg on thequery_doc_with_hybrid_searchcall. Without these, every/query/dochybrid request raised
AttributeError/TypeError.Test plan
chapters come back populated (no empty/coroutine content)
endpoints; confirm they download for the file owner and 403 for
non-owners
no longer fails with coroutine
.iderrorlinked into the target knowledge base (visible in the KB UI)
/query/dochybrid query (ENABLE_RAG_HYBRID_SEARCH=true);confirm no
AttributeError: hybrid_bm25_weightbleed across files when a
file_idfilter is suppliedconfirm vectors actually disappear from the Pinecone namespace
and every per-file namespace are removed (no Pinecone orphans)
Out of scope (planned follow-ups)
fix/spend-ledger-and-enforcement: cost computation innormalize_usage, recording on non-stream paths, enforcement on/api/v1/tasks/*, fail-closed policy.fix/migrations-storage-cache-loaders: storage cachebasename collisions, loader extension parsing, default Unstructured
strategy,
CONCURRENTLYmigration safety, header/down_revisionmismatches.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.