Files
open-webui-ai4me/backend/open_webui
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-17 11:27:58 +09:00
2026-04-19 22:45:54 +09:00
2026-04-20 00:07:34 +09:00
2026-04-20 08:34:15 +09:00
2026-04-17 13:29:51 +09:00
2026-04-19 22:45:54 +09:00
2026-04-12 19:08:30 -05:00
2026-03-17 17:58:01 -05:00
2026-04-19 23:42:09 +09:00
2026-04-20 08:34:15 +09:00
2026-03-24 15:41:26 -05:00
2026-04-19 22:45:54 +09:00
2026-04-14 17:27:31 -05:00
2026-04-17 11:27:58 +09:00
2026-04-17 14:15:36 +09:00
2026-04-19 23:38:58 +09:00
2026-03-17 17:58:01 -05:00