open-webui/backend/open_webui/models
Classic298 3d630491c6
fix: re-syncing an existing model no longer fails silently (#28036)
POST /api/v1/models/sync only worked when every model in the payload was new. As soon as one id already existed, the whole call blew up and the endpoint still answered HTTP 200 with an empty list, so nothing was updated and well-behaved clients saw a success. Only a first-ever sync into an empty catalogue went through.

The update branch splatted the model dump (which already carries user_id and updated_at) and then passed both again as explicit keyword arguments, which is a duplicate-keyword TypeError before SQLAlchemy ever sees it. The insert branch right below merged the same values into a dict first, so it never collided.

Fixed by building that dict once and using it for both branches, matching how sync_functions already does it. Left the broad exception handler alone: it is the reason the failure was silent, but changing the error contract of sync_models is a separate call.

Fixes #28033
2026-08-17 01:14:11 -06:00
..
access_grants.py chore: format 2026-07-27 00:12:47 -04:00
auths.py refac 2026-07-27 04:50:07 -04:00
automations.py refac 2026-08-13 16:42:10 -06:00
calendar.py refac 2026-07-27 02:44:21 -04:00
channels.py refac 2026-08-10 20:00:43 -06:00
chat_messages.py chore: remove dead json imports (#27815) 2026-07-31 17:25:40 -04:00
chats.py refactor: track visited ids when resolving a chat's current message (#28035) 2026-08-17 01:13:51 -06:00
config.py refac 2026-08-13 15:02:18 -06:00
feedbacks.py perf: drop redundant session.refresh calls after commit across the model layer (#27381) 2026-07-23 18:08:00 -05:00
files.py perf: drop redundant session.refresh calls after commit across the model layer (#27381) 2026-07-23 18:08:00 -05:00
folders.py fix: compare folder names for uniqueness with lower() equality instead of a LIKE pattern (#28695) 2026-08-17 00:00:02 -06:00
functions.py fix: prevent startup crash when function/tool has null user_id (#26850) 2026-07-24 00:00:37 -05:00
groups.py perf: index group_member on (user_id, group_id) (#27822) 2026-07-31 19:09:15 -05:00
knowledge.py chore: remove dead json imports (#27815) 2026-07-31 17:25:40 -04:00
memories.py refac 2026-07-24 01:54:36 -04:00
messages.py chore: remove dead json imports (#27815) 2026-07-31 17:25:40 -04:00
models.py fix: re-syncing an existing model no longer fails silently (#28036) 2026-08-17 01:14:11 -06:00
notes.py refac 2026-08-10 19:46:46 -06:00
oauth_sessions.py refac 2026-07-31 17:41:14 -04:00
prompt_history.py chore: remove dead json imports (#27815) 2026-07-31 17:25:40 -04:00
prompts.py refac 2026-07-31 17:41:14 -04:00
shared_chats.py feat(ui): add 'Unshare All Shared Chats' button to Shared Chats modal (#25848) 2026-06-17 03:06:41 +02:00
skills.py refac 2026-07-27 02:44:21 -04:00
tags.py perf: build debug log messages lazily so disabled debug logs cost nothing (#27834) 2026-07-31 19:09:01 -05:00
tools.py refac 2026-07-27 02:44:21 -04:00
users.py refactor: match provider identity lookups via JSON subscript (#28624) 2026-08-17 01:05:16 -06:00