open-webui/backend/open_webui
Classic298 b4f340806a
fix: migration streaming/batching (#21542)
* fix: normalize usage tokens + migration streaming/batching

- Migration: replace .fetchall() with yield_per streaming, replace per-message INSERT+SAVEPOINT with batched inserts (5k/batch) with fallback to row-by-row on error, add progress logging

- Write path: call normalize_usage() in upsert_message() before saving to ensure input_tokens/output_tokens always present

- Read path: analytics queries now COALESCE across input_tokens/prompt_tokens and output_tokens/completion_tokens so historical data with OpenAI-format keys is visible

* fix: restore defensive timestamp conversion in migration

Re-add try/except around int(float(timestamp)) that was accidentally dropped. Without this, a non-numeric timestamp string would cause a TypeError on the subsequent comparison, breaking the entire upgrade.

* revert: remove changes to chat_messages.py
2026-03-07 19:08:11 -05:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal fix: use NullPool for SQLCipher engine to prevent segfault (#22273) 2026-03-06 14:04:10 -06:00
migrations fix: migration streaming/batching (#21542) 2026-03-07 19:08:11 -05:00
models refac 2026-03-06 20:12:37 -06:00
retrieval fix: offline model retrieval, re-raise to disable instead of returning useless fallback (#22106) 2026-03-01 13:52:31 -05:00
routers refac 2026-03-06 20:12:37 -06:00
socket feat: Timeout for event_call events (#22222) 2026-03-04 16:39:53 -06:00
static refac 2025-08-10 00:02:58 +04:00
storage chore: format 2026-02-11 16:24:11 -06:00
test refac 2026-02-21 14:19:28 -06:00
tools refac 2026-03-07 17:13:19 -06:00
utils refac 2026-03-07 17:29:24 -06:00
__init__.py Update __init__.py 2025-04-15 09:55:35 +02:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py fix: correct conflicting output format instruction in follow-up generation prompt (#22212) 2026-03-06 14:25:42 -06:00
constants.py feat/enh: optional password validation 2025-11-20 17:44:49 -05:00
env.py refac 2026-03-06 20:12:37 -06:00
functions.py chore: format 2026-02-11 16:24:11 -06:00
main.py perf: convert APIKeyRestrictionMiddleware to pure ASGI (#22188) 2026-03-06 14:54:03 -06:00
tasks.py refac 2026-02-12 15:29:34 -06:00