github Fu-Jie/openwebui-extensions github-copilot-sdk-v0.13.1
GitHub Copilot Official SDK Pipe v0.13.1

14 hours ago

This release adds compatibility support for Open WebUI 0.9.x.

Compatibility

  • Open WebUI 0.9.x compatibility: Detects Open WebUI version at runtime and adapts database access accordingly.
  • Async DB fix: Users.get_user_by_id and Chats.get_chat_by_id now use the correct async/sync call path based on Open WebUI version.

Release Scope: v0.13.1 is a critical compatibility release that adds transparent dual-support for OpenWebUI 0.9.x async APIs and retains full compatibility with pre-0.9 (sync) versions. No Valve keys were added, removed, or renamed. No functional behavior changes for users on older OpenWebUI versions.


Overview

OpenWebUI 0.9.0 introduced a sweeping async migration: nearly every database-backed model method (Files, Users, Tools, Models, etc.) and many helpers in open_webui.config and open_webui.utils.tools are now async def and must be awaited. The plugin's internal call graph had numerous direct (non-awaited) calls into these APIs, which would silently break on 0.9.x — coroutine objects returned instead of results, or runtime crashes in thread-offload paths.

Rather than splitting the codebase by version, v0.13.1 introduces a thin compatibility layer that auto-detects whether an OpenWebUI API call returns a coroutine or a direct value, and handles both transparently. This keeps a single codebase working across OpenWebUI versions.


Changes

  • New Compatibility Helpers: Added four module-level helpers at the top of github_copilot_sdk.py:

    • _resolve_awaitable_compat() — resolves a value or coroutine uniformly
    • _call_openwebui_compat() — async-compatible caller with optional thread-offload for sync-only APIs
    • _resolve_awaitable_sync() — resolves a coroutine from synchronous context (used in Valve option providers)
    • _call_openwebui_sync_compat() — sync wrapper around _resolve_awaitable_sync
    • _extract_search_result_items() — extracts .items from search results that may be a list, tuple, dict, or Pydantic model
  • Files API Compatibility: publish_file_from_workspace now uses _call_openwebui_compat(Files.get_file_by_id, ...) and _call_openwebui_compat(Files.insert_new_file, ...) instead of raw asyncio.to_thread. This prevents the silent crash where an async Files method passed to to_thread returns a coroutine object instead of the expected file record.

  • Tool Server Config & Request Building Promoted to Async: _read_tool_server_connections and _build_openwebui_request are now async def. All callers updated to await. Handles get_config() and Models.get_all_models() which are async in 0.9.x.

  • Tool Loading Chain Compatibility: Users.get_user_by_id, Tools.get_tools_by_user_id, Tools.get_tool_by_id, get_openwebui_tools, get_builtin_tools, and Models.get_model_by_id in all tool-loading paths are now called through _call_openwebui_compat(...) with prefer_thread_for_sync=True.

  • MCP Server Parsing Promoted to Async: _parse_mcp_servers is now async def. Callers in async paths use await directly. The one caller in a synchronous context (_build_session_config) uses _resolve_awaitable_sync(...) for safe bridging.

  • Sync Valve Option Providers Safe: Valves and UserValves classmethods that call OWModels.search_models(...) (sync in pre-0.9, potentially async in 0.9.x) now use _call_openwebui_sync_compat(...) instead of direct calls. The result iteration uses _extract_search_result_items(...) instead of .items attribute access.

  • Agent Team Model Search Compatibility: _get_openwebui_models_by_tag and _get_openwebui_model_by_id (async methods) now use _call_openwebui_compat(...) for search_models calls.

  • Models.get_model_by_id in System Prompt Extraction: _extract_system_prompt now uses _call_openwebui_compat(...) for the model DB lookup in its async loop.


Migration Notes

  • No action required for users already on OpenWebUI < 0.9. The compatibility layer detects sync behavior and calls functions directly as before.
  • Users upgrading to OpenWebUI 0.9.x will now have a fully functional Copilot SDK Pipe without any plugin updates or config changes.
  • No Valve keys were added, removed, or renamed.
  • All changes are internal to the API call layer.

Version Changes

Plugin Updates

  • GitHub Copilot Official SDK Pipe: v0.13.0 → v0.13.1 | 📖 README

📚 Documentation Portal
🐛 Report Issues

Don't miss a new openwebui-extensions release

NewReleases is sending notifications on new releases.