Commit Graph
681 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 0c64e5d596 chore: format 2026-11-03 17:36:03 +09:00
Timothy Jaeryang Baek 2840f0e07b refac 2026-11-02 12:47:34 +09:00
Timothy Jaeryang Baek ddb43c83ba refac 2026-11-02 12:45:15 +09:00
Timothy Jaeryang Baek 789a0f402a refac 2026-11-02 11:37:00 +09:00
Timothy Jaeryang Baek d99ec1c02c refac 2026-11-02 08:48:51 +09:00
Timothy Jaeryang Baek 3814b7b2f1 refac 2026-10-31 16:50:01 +09:00
Timothy Jaeryang Baek 9d1b4ef362 refac 2026-10-30 16:01:47 +09:00
Timothy Jaeryang Baek 7618df3f53 refac 2026-10-30 07:08:28 +09:00
Timothy Jaeryang Baek 44a9d499db refac 2026-10-29 17:39:31 +09:00
Classic298andGitHub a59cab0aa9 perf: knowledge base changes slow down as the knowledge base grows (#33335)
Adding, updating or removing knowledge base files through the API sent back the metadata of every file in the knowledge base, and so did renaming a knowledge base or changing its access. These calls got slower as the knowledge base grew, so bulk ingestion through the API lost speed with every batch. Adding or updating files now returns only those files, while removing a file, renaming or changing access returns an empty files list. API clients that read the files list from these responses now get only the affected files; the full list stays available, paginated, from `GET /api/v1/knowledge/{id}/files`. Timings with a local mock embedding server that answers instantly, median of 5 runs (at 1,000 files the per-file work of a batch still hides the difference):

| Files already in the knowledge base | Call | Before | After | Response size before | Response size after |
|---|---|---|---|---|---|
| 1,000 | batch add of 100 files | 519 ms | 528 ms | 437 KB | 39 KB |
| 10,000 | batch add of 100 files | 679 ms | 476 ms | 4.0 MB | 39 KB |
| 10,000 | single file add | 184 ms | 36 ms | 4.0 MB | 0.6 KB |

Closes #31397
2026-10-29 17:00:29 +09:00
Classic298andGitHub 226dca18cd fix: member's chat loses its pin when the shared folder owner moves it (#33342)
When the owner of a shared folder moved a chat a member created to another folder inside the shared folder, the chat lost the member's pin and dropped out of their Pinned list. The owner's move now keeps the member's pin, just as it already keeps the chat's unread status for them. Moving your own chat into a folder still unpins it, as before, so it shows up in that folder.

Fixes #33341
2026-10-29 08:05:16 +09:00
Classic298andGitHub 517f824eb4 perf: kb_exec reads the full text of the whole knowledge base on every call (#33332)
Every kb_exec command (ls, cat, grep and the rest) and the knowledge base sync check listed the knowledge base by loading each file's full extracted text, even though only names, folders, sizes and hashes were used. On large knowledge bases every call took seconds, held hundreds of MB of memory and blocked the server for other users while it ran. The listing now reads only those fields, and file text is still loaded per file when a command needs it, as before. Output is byte-identical.

5,005 files (5,000 of 50 KB in 50 folders plus 5 of 10 MB, 292 MB of text), median of 3 calls, Postgres 17:

| kb_exec command | before | after | peak memory before | after |
|---|---|---|---|---|
| `ls` | 2.34 s | 0.20 s | 874 MB | 243 MB |
| `ls folder_000/` | 2.15 s | 0.20 s | 873 MB | 243 MB |
| `cat folder_000/doc_000_001.md` | 1.07 s | 0.17 s | 855 MB | 243 MB |
| `grep -n needle folder_000/` | 1.24 s | 0.31 s | 871 MB | 243 MB |
| `grep -c needle large_0.md` | 1.19 s | 0.22 s | 874 MB | 306 MB |

On SQLite the same calls drop from 0.50-1.03 s to 0.16-0.29 s.

Fixes #33322
2026-10-29 05:26:02 +09:00
Classic298andGitHub f1f0a194ae feat: choose the Mistral OCR model and pass extra OCR request options (#33333)
Mistral OCR always sent the mistral-ocr-latest model with no other request options, so admins could not stay on an older OCR model or send the model name a Mistral-compatible endpoint such as Azure AI Foundry expects. A new Parameters field under Admin Panel > Settings > Documents, shown when Mistral OCR is the extraction engine and also available as the MISTRAL_OCR_PARAMS environment variable, takes a JSON object that is merged into every OCR request: {"model": "mistral-ocr-2512"} replaces the default model, and any other field is sent to the OCR endpoint as given. It works the same with and without the Use Base64 switch, and when it is left empty the request is unchanged.

Closes #19707
2026-10-29 05:25:53 +09:00
Classic298andGitHub 40a9fba81f feat: moving a chat into or out of a folder keeps its last activity date (#33327)
Filing an old chat into a folder made it look recently active: it jumped to the top of the sidebar under Today, and a batch of old chats sorted into folders ended up ordered by when each was moved. Moving a chat into or out of a folder now keeps its last activity date, so it is sorted and grouped by when it was really last active. Moving your own chat still clears its unread dot as before, and when the owner of a shared folder reorganizes your chat within it, the chat no longer turns unread for you.

Closes #30362
2026-10-29 05:21:30 +09:00
Timothy Jaeryang Baek 7f03b6e778 refac 2026-10-28 10:25:04 +09:00
Timothy Jaeryang Baek b34885efc6 refac 2026-10-28 10:02:45 +09:00
G30andGitHub 6635a45df4 fix: the Local source filter on Workspace > Knowledge lists knowledge bases made with Create (#33199) 2026-10-26 17:31:16 +09:00
G30andGitHub 02821c5058 fix: a model's Chats tab in Analytics follows the User group filter (#33207) 2026-10-26 17:27:32 +09:00
Timothy Jaeryang Baek e69392fd2b refac 2026-10-26 16:09:25 +09:00
Timothy Jaeryang Baek 7b303cf496 refac 2026-10-26 07:24:36 +09:00
Timothy Jaeryang Baek 97650bbbea refac 2026-10-25 16:02:56 +09:00
Timothy Jaeryang Baek 5f95008abd refac 2026-10-25 14:20:56 +09:00
Classic298andGitHub e1e31973f0 perf: renaming a folder or deleting all chats takes seconds when many users are online (#32888)
* perf: renaming a folder or deleting all chats takes seconds when many users are online

Renaming, sharing, moving or deleting a folder, and deleting all chats, each made the server recheck access for every chat that any online user had open in a browser tab, one database lookup at a time, before the request finished, and every one of those open chats reloaded its contents afterwards. Any user can do these, so with a few thousand people online every such click took several seconds and reloaded everyone's open chat. Owners keep access to their own chats (a role change or account deletion already disconnects them), so the recheck now skips owners entirely, with no lookup and no reload, and only checks people viewing someone else's chat and chats that no longer exist. Anyone who lost access is still removed from the chat as before.

Postgres 16, one open chat per online user, 2% of them viewing someone else's chat, time for a folder rename (the other actions above run the same recheck):

| Online users | No Redis, before | No Redis, after | Redis, before | Redis, after |
| --- | --- | --- | --- | --- |
| 1,000 | 2.2 s | 0.12 s | 2.5 s | 0.23 s |
| 3,000 | 6.9 s | 0.60 s | 7.7 s | 0.78 s |

* refac: collect the open chats with a plain loop

Same behaviour, the owner lookup now reads more plainly.

* refac: shorten the owner comment in the chat access sweep
2026-10-25 07:21:47 +09:00
Timothy Jaeryang Baek 2262073146 refac 2026-10-24 04:50:12 +09:00
Classic298andGitHub b7d1de05ab perf: changing permissions on a large group is slow (#32883)
When a group change affects its members (new permissions, parent group or default models, or deleting the group), the server makes every member's browser reconnect so it picks up the new permissions without a page reload. To find each member's connections it read through the whole list of connected users again for every single member, so saving a 2,000-member group with 3,000 people online spent almost 9 seconds on this with Redis as the websocket manager, and about 1 second without. It now finds all members' connections in one pass.

Changing one permission on a 2,000-member group, time the save spends making members reconnect:

| Online users | Redis, before | Redis, after | No Redis, before | No Redis, after |
| --- | --- | --- | --- | --- |
| 1,000 | 2.8 s | 0.15 s | 0.09 s | <0.01 s |
| 3,000 | 8.7 s | 0.28 s | 1.2 s | <0.01 s |
2026-10-22 07:08:30 +09:00
Timothy Jaeryang Baek 3539ad6321 refac 2026-10-21 16:35:31 +09:00
Timothy Jaeryang Baek 131ddc32ec refac 2026-10-21 11:07:10 +09:00
Timothy Jaeryang Baek b4a58be193 refac 2026-10-21 09:15:15 +09:00
G30andGitHub 97f5c4e973 fix: Archive All Chats takes chats out of their folders, so deleting a folder no longer deletes them (#32647) 2026-10-21 03:18:03 +09:00
Classic298andGitHub 93ba628f3a fix: generated images never show up after the user answers the model's question or approves a tool (#32680)
When the model asked the user a question, or a tool call was approved or rejected, the reply was saved in a way that broke adding anything to it later in the same turn. If the model then generated an image, the image was created but never shown, the tool returned "unsupported operand type(s) for +: 'NoneType' and 'list'" and the model kept retrying, generating more hidden images. Progress status updates for that reply were also silently dropped. Both now work after a question or tool approval.

Fixes #32678
2026-10-21 02:39:39 +09:00
G30andGitHub 312d113fd0 Merge pull request #32709 from silentoplayz/fix/prompt-save-unchanged-no-version
fix: saving a prompt without changes adds no version to its history
2026-10-21 01:06:59 +09:00
Timothy Jaeryang Baek 4b81b12ed4 chore: format 2026-10-16 15:20:15 +04:00
Timothy Jaeryang Baek 788a61180b refac 2026-10-16 04:20:14 +04:00
Timothy Jaeryang Baek b4db56ae96 refac 2026-10-16 02:46:20 +04:00
Timothy Jaeryang Baek 00f12c0e47 refac 2026-10-14 18:49:51 +04:00
G30andGitHub 29289f5ba6 fix: deleting a message in the middle of a chat keeps the earlier messages in the model's context (#32332) 2026-10-14 18:30:31 +04:00
Timothy Jaeryang Baek 323139cdf5 refac 2026-10-14 18:11:14 +04:00
Timothy Jaeryang Baek 35c927ba99 refac 2026-10-14 14:59:41 +04:00
Timothy Jaeryang Baek e5c80682b9 refac 2026-10-14 14:41:26 +04:00
Timothy Jaeryang Baek ed8c744e77 refac 2026-10-14 00:19:15 +04:00
Timothy Jaeryang Baek 3f6c3e31a0 refac 2026-10-13 22:04:15 +04:00
Timothy Jaeryang Baek be6f0a6656 refac 2026-10-13 17:22:11 +04:00
G30andGitHub 99a9f60b9f fix: a model added before Regenerate stays side by side after reload (#32326) 2026-10-13 16:46:01 +04:00
Timothy Jaeryang Baek 4ca8fdc3fd refac 2026-10-13 01:55:12 +04:00
Timothy Jaeryang Baek 03f5191aca refac 2026-10-13 01:49:55 +04:00
Timothy Jaeryang Baek 1786d6cdb0 refac 2026-10-13 00:43:00 +04:00
Timothy Jaeryang Baek d823ebd96d refac 2026-10-12 23:59:19 +04:00
Classic298andGitHub 113a64ad1a perf: speed up one-word chat search (#32268)
Chat search checks the whole query and each word in it separately. With a single word those are the same check, so every chat got searched twice. It is now searched once, with the same results. On PostgreSQL with 2164 chats (533 MB of chat data) a one-word search is about 40% faster:

| search | before | after |
|---|---|---|
| proxy | 6.0 s | 3.6 s |
| opnsense | 6.1 s | 3.8 s |
| no match | 5.4 s | 3.0 s |

Refs #32266
2026-10-12 23:32:52 +04:00
Timothy Jaeryang Baek 4ab60527e7 refac 2026-10-12 22:14:04 +04:00
Timothy Jaeryang Baek 6229405b4d refac 2026-10-12 19:08:40 +04:00