Files
open-webui-ai4me/backend/open_webui/routers
Classic298andClaude b3ca943da1 perf(channels): batch user lookup in model_response_handler thread history (#23795)
* perf(channels): batch user lookup in model_response_handler thread history

The thread-history builder in model_response_handler called
Users.get_user_by_id once per thread message (deduped via an intra-loop
dict), producing N individual SELECTs for a thread of N unique authors.

Replace with a single Users.get_users_by_user_ids call that returns all
authors in one WHERE id IN (...) query, matching the batch pattern
already used elsewhere in this file (lines 739, 804, 1320).

Behavior is preserved: deleted users still resolve to None and fall
through to the existing 'Unknown' fallback via .get().

* refac(channels): rename loop vars to full words per review

Address reviewer feedback to use descriptive names `message` and `user`
instead of single-letter `m` and `u` in the batch user-lookup
comprehensions.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-20 08:37:07 +09:00
..
2026-04-12 18:12:59 -05:00
2026-04-20 08:34:15 +09:00
2026-04-20 08:34:15 +09:00
2026-04-19 22:33:32 +09:00
2026-04-20 00:09:24 +09:00
2026-04-17 10:16:32 +09:00
2026-04-20 08:34:15 +09:00
2026-04-12 18:12:59 -05:00
2026-04-14 10:55:11 -05:00
2026-04-12 18:12:59 -05:00
2026-04-20 08:36:24 +09:00
2026-04-12 14:22:11 -05:00
2026-04-17 11:48:17 +09:00
2026-04-19 22:45:54 +09:00
2026-04-17 14:28:18 +09:00
2026-04-17 13:33:11 +09:00
2026-04-14 17:22:54 -05:00
2026-04-17 14:15:36 +09:00
2026-04-20 08:36:24 +09:00
2026-03-24 04:49:48 -05:00
2026-04-13 14:08:58 -05:00
2026-04-17 14:28:18 +09:00
2026-04-12 14:22:11 -05:00
2026-04-12 14:22:11 -05:00
2026-04-13 14:08:58 -05:00
2026-04-20 08:36:24 +09:00
2026-04-20 08:36:24 +09:00
2026-04-13 14:08:58 -05:00