Skip to content

Compatibility with Open WebUI >= 0.9.0 (async DB APIs) — venice_image_generation#263

Merged
suurt8ll merged 1 commit into
suurt8ll:masterfrom
NickFranceschina:venice-async-0.9.0-compat
May 26, 2026
Merged

Compatibility with Open WebUI >= 0.9.0 (async DB APIs) — venice_image_generation#263
suurt8ll merged 1 commit into
suurt8ll:masterfrom
NickFranceschina:venice-async-0.9.0-compat

Conversation

@NickFranceschina
Copy link
Copy Markdown
Contributor

Summary

Open WebUI v0.9.0 converted the Files and Functions DB helpers to async def. The venice_image_generation pipe calls two of these synchronously, which on >=0.9.0 raises 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.py

  • Removed the sync Functions.get_function_valves_by_id("venice_image_generation") call from Pipe.__init__. It's async upstream and would raise at import time. __init__ now uses self.Valves() defaults. Open WebUI's pipe pipeline assigns the DB-backed valves onto the instance before every pipes/pipe call, so configured valves still take effect at runtime. The existing pipes() method already detects LOG_LEVEL changes and reruns the logging setup once real valves land.
  • Dropped the now-unused from open_webui.models.functions import Functions import.
  • _upload_image promoted to async; await Files.insert_new_file(...). Call site in pipe() updated to await self._upload_image(...).
  • Storage.upload_file remains sync upstream — wrapped in asyncio.to_thread(...) (both the has_tags and legacy branches) so it doesn't block the event loop now that the method is async.

Validation

  • ast.parse clean.
  • Diff is scoped to exactly this one file.
  • Tested live against a local Open WebUI >= 0.9.0: image generation + Files-API upload work, and the import-time coroutine errors are gone.

🤖 Generated with Claude Code

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(...).
@suurt8ll
Copy link
Copy Markdown
Owner

lgtm!

@suurt8ll suurt8ll merged commit 0f53edd into suurt8ll:master May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants