Compatibility with Open WebUI >= 0.9.0 (async DB APIs) — venice_image_generation#263
Merged
suurt8ll merged 1 commit intoMay 26, 2026
Conversation
Open WebUI v0.9.0 converted the Files / Functions DB helpers to async.
The venice_image_generation pipe called two of these synchronously, which
on >=0.9.0 raises at import/request time (coroutine was never awaited /
'coroutine' object is not subscriptable).
venice_manifold.py (pipe), version 0.10.1 -> 0.11.0:
* Remove the sync Functions.get_function_valves_by_id(...) call from
__init__ (it is async upstream and would raise at import time).
Initialize with self.Valves() defaults; Open WebUI's pipe pipeline
assigns the DB-backed valves onto the instance before each
pipes/pipe call, so configured valves still apply at runtime. The
pipes method already reruns the logging setup on LOG_LEVEL change.
* Drop the now-unused open_webui.models.functions import.
* _upload_image is now async; await Files.insert_new_file.
* Storage.upload_file is still sync upstream, wrapped in
asyncio.to_thread so it doesn't block the event loop.
* pipe() call site updated to await self._upload_image(...).
Owner
|
lgtm! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Open WebUI v0.9.0 converted the
FilesandFunctionsDB helpers toasync def. Thevenice_image_generationpipe calls two of these synchronously, which on>=0.9.0raises at import/request time (e.g.RuntimeWarning: coroutine ... was never awaited,'coroutine' object is not subscriptable).This is the same root cause (and follows the same approach) as #258, which fixed the gemini pipe/filter. This PR applies the equivalent fix to the Venice pipe while keeping behavior identical on older versions that still expose the same method names.
Version bumped: 0.10.1 → 0.11.0.
plugins/pipes/venice_manifold.pyFunctions.get_function_valves_by_id("venice_image_generation")call fromPipe.__init__. It'sasyncupstream and would raise at import time.__init__now usesself.Valves()defaults. Open WebUI's pipe pipeline assigns the DB-backed valves onto the instance before everypipes/pipecall, so configured valves still take effect at runtime. The existingpipes()method already detectsLOG_LEVELchanges and reruns the logging setup once real valves land.from open_webui.models.functions import Functionsimport._upload_imagepromoted toasync;await Files.insert_new_file(...). Call site inpipe()updated toawait self._upload_image(...).Storage.upload_fileremains sync upstream — wrapped inasyncio.to_thread(...)(both thehas_tagsand legacy branches) so it doesn't block the event loop now that the method is async.Validation
ast.parseclean.>= 0.9.0: image generation + Files-API upload work, and the import-time coroutine errors are gone.🤖 Generated with Claude Code