Commit Graph

16272 Commits

Author SHA1 Message Date
Timothy Jaeryang Baek
f0ec5ee08f refac 2026-04-19 21:49:48 +09:00
Timothy Jaeryang Baek
4a5401b417 refac 2026-04-19 21:48:27 +09:00
Timothy Jaeryang Baek
8d739e2aba feat: calendar 2026-04-19 19:15:05 +09:00
Timothy Jaeryang Baek
5087492e25 refac 2026-04-19 15:49:42 +09:00
Timothy Jaeryang Baek
a4d62253df refac 2026-04-18 06:23:50 +09:00
Timothy Jaeryang Baek
7cfb260b8a refac 2026-04-17 15:01:42 +09:00
Timothy Jaeryang Baek
49430de42d refac 2026-04-17 15:00:17 +09:00
Timothy Jaeryang Baek
1be9627dd2 refac 2026-04-17 14:57:49 +09:00
Classic298
f0e0cfcf02 perf: avoid redundant knowledge re-fetch in update_knowledge_access_by_id (#23799)
After set_access_grants, the handler was reloading the same knowledge
record via get_knowledge_by_id, which triggers an extra SELECT plus a
nested fetch of access grants. set_access_grants already returns the
newly-written grants and the local knowledge object is otherwise
unchanged, so update it in place and reuse it for the response.

https://claude.ai/code/session_01S18Lgqbih7Ry2JZUUv8TxF

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-17 14:44:42 +09:00
Timothy Jaeryang Baek
55bfc7cbc2 refac 2026-04-17 14:35:13 +09:00
Timothy Jaeryang Baek
4113b15a60 chore: format 2026-04-17 14:28:18 +09:00
Timothy Jaeryang Baek
e8e655d0de chore: dep bump 2026-04-17 14:24:34 +09:00
Algorithm5838
e5f31c2e14 perf: replace JSON.stringify equality with fast-deep-equal (#23370) 2026-04-17 14:22:06 +09:00
Timothy Jaeryang Baek
c5276f62d0 refac 2026-04-17 14:18:45 +09:00
Timothy Jaeryang Baek
8acce144f9 refac 2026-04-17 14:15:36 +09:00
Timothy Jaeryang Baek
e7e752f8e7 refac 2026-04-17 14:09:35 +09:00
Timothy Jaeryang Baek
f44b7a01f5 refac 2026-04-17 13:59:46 +09:00
Timothy Jaeryang Baek
2c7acb9285 refac 2026-04-17 13:58:32 +09:00
Timothy Jaeryang Baek
50363ba66b refac 2026-04-17 13:52:11 +09:00
Timothy Jaeryang Baek
860b90fd17 refac 2026-04-17 13:47:21 +09:00
Timothy Jaeryang Baek
914ccf07ef refac 2026-04-17 13:37:52 +09:00
Timothy Jaeryang Baek
ba83613ff2 refac 2026-04-17 13:35:35 +09:00
Timothy Jaeryang Baek
499129625b refac
Co-Authored-By: Classic298 <27028174+Classic298@users.noreply.github.com>
2026-04-17 13:33:11 +09:00
Timothy Jaeryang Baek
3271b013a8 refac 2026-04-17 13:29:51 +09:00
Timothy Jaeryang Baek
638c7ab802 refac 2026-04-17 13:27:58 +09:00
Timothy Jaeryang Baek
4023f6722b refac 2026-04-17 13:16:56 +09:00
Timothy Jaeryang Baek
e695d854f2 refac 2026-04-17 13:10:06 +09:00
Timothy Jaeryang Baek
34d569d564 refac 2026-04-17 13:04:07 +09:00
Timothy Jaeryang Baek
e709d6812f refac 2026-04-17 12:55:56 +09:00
Timothy Jaeryang Baek
3dd8255816 refac 2026-04-17 12:37:44 +09:00
Classic298
32cfb5788a perf(chats): select only meta column in get_chat_tags_by_id_and_user_id (#23798)
Avoid loading the full Chat row (including the potentially large `chat`
JSON column) just to read tag IDs from `meta.tags`. Issue a narrow
SELECT on `Chat.meta` instead, which is much cheaper for chats with
large message histories.

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-17 12:35:58 +09:00
Classic298
2dca850cee perf: use set for O(1) lookup in insert_chat_files dedupe (#23800)
Convert chat_message_file_ids from list to set so the membership test
in the comprehension is O(1) instead of O(m), turning the dedupe from
O(n*m) into O(n+m). Also replace the redundant set([...]) with a set
comprehension.

https://claude.ai/code/session_01Le3NnqNhcgaJvFrDZGqmwe

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-17 12:28:34 +09:00
Timothy Jaeryang Baek
349ea4ea9e refac 2026-04-17 12:25:43 +09:00
Timothy Jaeryang Baek
3c22afc5a6 refac 2026-04-17 12:07:23 +09:00
Timothy Jaeryang Baek
7e453de4f7 refac 2026-04-17 11:54:19 +09:00
Timothy Jaeryang Baek
f1ef09ddc8 refac 2026-04-17 11:48:17 +09:00
Shirasawa
7b5880ab9e fix: clean up Mermaid temporary DOM nodes after render failures (#23727)
* fix: clean up Mermaid temporary DOM nodes after render failures

* fix: prevent Mermaid temp DOM artifacts from accumulating
2026-04-17 11:44:10 +09:00
Timothy Jaeryang Baek
3332878321 refac 2026-04-17 11:29:59 +09:00
Classic298
e396af3cc8 perf: reuse request db session in get_model_profile_image (#23796)
Pass the request-scoped AsyncSession into Models.get_model_by_id so the
endpoint no longer opens a fresh DB session on every call, avoiding an
extra connection acquisition per profile image request.

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-17 11:28:19 +09:00
Timothy Jaeryang Baek
7cc7b367dc refac 2026-04-17 11:27:58 +09:00
Classic298
5eae0a5cdd perf(users): drop redundant get_user_by_id refetch in session-user endpoints (#23794)
* perf(users): drop redundant get_user_by_id refetch in session-user endpoints

Five /user/* handlers refetched the user row via Users.get_user_by_id(user.id)
immediately after receiving an identical UserModel from Depends(get_verified_user).
Since get_verified_user already populated the user within the same request
microseconds earlier, the refetch is pure overhead. The dead else branches
(unreachable — get_verified_user raises 401 on missing user) are removed as
a natural consequence.

Affected endpoints:
- GET  /user/settings
- GET  /user/status
- POST /user/status/update
- GET  /user/info
- POST /user/info/update

Eliminates one SELECT per request to each of these endpoints with no behavioral
change.

* fix(users): preserve USER_NOT_FOUND error on status update failure

update_user_status_by_id returns None when the target user is missing or
the update raises. The previous commit removed the pre-update existence
gate (get_user_by_id) and returned the update result directly, which
turned not-found/failure cases into 200 OK with a null body instead of
the expected 400 USER_NOT_FOUND.

Guard the update result explicitly to preserve the original API contract,
matching the equivalent pattern already applied in /user/info/update.

* docs(users): note lost-update tradeoff on /user/info/update

Make the concurrency tradeoff explicit: merging against the auth-time
snapshot slightly widens the lost-update window compared to the previous
pre-merge refetch, but the refetch only narrowed (did not eliminate) that
window. Real safety requires row locking or a version column.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-17 11:23:08 +09:00
_00_
0e50d2b741 upd:i18n Update es-ES Spanish translations v0.9.0 (#23757)
### Update es-ES Spanish translations v0.9.0

Updated new strings
2026-04-17 11:22:28 +09:00
Algorithm5838
7aed64be3c fix: chat:outlet update overwritten by stale write-back (#23829) 2026-04-17 11:19:27 +09:00
Timothy Jaeryang Baek
43e5905c13 refac 2026-04-17 11:18:48 +09:00
Timothy Jaeryang Baek
128cf41fce refac 2026-04-17 11:12:42 +09:00
Timothy Jaeryang Baek
398718d505 refac 2026-04-17 10:44:29 +09:00
Timothy Jaeryang Baek
bd35809105 refac 2026-04-17 10:22:43 +09:00
Timothy Jaeryang Baek
2e52ad8ff2 refac: shared chat 2026-04-17 10:16:32 +09:00
Timothy Jaeryang Baek
4d2f189810 feat: add RAG_RERANKING_BATCH_SIZE configuration option
Add configurable reranker batch size (env var RAG_RERANKING_BATCH_SIZE,
default 32) following the same pattern as RAG_EMBEDDING_BATCH_SIZE.

- config.py: PersistentConfig for RAG_RERANKING_BATCH_SIZE
- main.py: import, state init, pass to get_reranking_function
- colbert.py: accept batch_size param in predict() (was hardcoded 32)
- utils.py: get_reranking_function passes batch_size at call time
- retrieval.py: expose in config GET/POST endpoints and ConfigForm
- Documents.svelte: add Reranking Batch Size input in admin settings

Closes #23730
2026-04-17 08:35:45 +09:00
Timothy Jaeryang Baek
70a6a24f14 refac 2026-04-15 10:37:59 -07:00