2154 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 4b648ec4e7 refac 2026-11-26 02:04:30 +04:00
Timothy Jaeryang Baek 9c9a3ca0d6 refac 2026-11-26 01:31:48 +04:00
Timothy Jaeryang Baek 9a596e2eed refac 2026-11-26 00:47:50 +04:00
Classic298 7e5634d208 fix: attaching a file without pandoc sometimes shows a raw error instead of "Pandoc is not installed" (#35065)
On a server without pandoc, attaching a file that needs it could show the raw library error, which tells the user to install pandoc themselves, instead of "Pandoc is not installed on the server". The raw error was saved first and replaced with the friendly message a moment later, and the chat often picked up the raw one in between. The friendly message is now saved right away, so the warning toast always shows it.

Fixes #35064
2026-11-25 13:27:53 +04:00
Timothy Jaeryang Baek efcbd9c6d7 refac 2026-11-25 13:21:47 +04:00
Timothy Jaeryang Baek 1c2c3e794e refac 2026-11-25 13:16:37 +04:00
Classic298 18b9b449c7 fix: deleting a note leaves its chat counted in admin analytics (#35059)
Deleting a note, on its own or with the folder holding it, removed the note but kept the conversation from its chat panel. Admin analytics went on counting its messages and tokens, listed it as a session and showed its messages. Deleting a note now deletes its chats too, for everyone who chatted with it.

Fixes #35057
2026-11-25 13:13:28 +04:00
Classic298 cdf38c4a72 fix: deleting a folder or all chats leaves their replies and sub-agents running (#35058)
Deleting a single chat stops a reply that is still being written and any sub-agent it handed work to. Deleting a folder with its chats, or all chats, removed the chats but left that work running, so replies kept streaming from the provider and a sub-agent left running kept its background slot, refusing the next delegation with "Async subagent capacity reached". Both now stop the running work of every chat they delete, including its sub-agents, as deleting a single chat does.

Fixes #35056
2026-11-25 13:13:17 +04:00
Timothy Jaeryang Baek b0d5c67f76 refac 2026-11-25 13:06:56 +04:00
Classic298 f7d437324d fix: deleting one listed vector store removes the whole connection (#35043)
With "List stores as knowledge bases" on, an admin sees Delete on each store in Workspace > Knowledge. Deleting one store reported success but removed the entire connection, so every store of it disappeared for every user, and models lost the store they had attached. These stores live on the endpoint and are read-only, so deleting one is now refused with the read-only error and the connection, its stores and the models stay as they were.

Fixes #35042
2026-11-25 12:39:25 +04:00
Classic298 991bb4609f fix: exporting chats, the archived chats list and Unarchive All slow down with many chats (#35005)
Since #34689 stored every message on its own, every action that loads many chats with their messages read them one chat at a time, so exporting chats, a folder's export, the admin's All Chats export and the archived chats list got several times slower, growing with the number of chats. The messages of the listed chats now come in one read per 500 chats. Unarchive All only needs to know which chats are archived and no longer loads any messages.

<table>
<tr><th>1000 chats, 10 messages each</th><th>SQLite before #34689</th><th>SQLite now</th><th>SQLite fix</th><th>PostgreSQL before #34689</th><th>PostgreSQL now</th><th>PostgreSQL fix</th></tr>
<tr><td>Export Chats</td><td>0.26 s</td><td>1.00 s</td><td>0.58 s</td><td>0.27 s</td><td>1.82 s</td><td>0.46 s</td></tr>
<tr><td>Folder export</td><td>0.21 s</td><td>1.86 s</td><td>0.51 s</td><td>0.19 s</td><td>1.09 s</td><td>0.42 s</td></tr>
<tr><td>Archived chats list</td><td>0.25 s</td><td>1.08 s</td><td>0.57 s</td><td>0.21 s</td><td>1.11 s</td><td>0.40 s</td></tr>
<tr><td>Unarchive All</td><td>0.07 s</td><td>1.13 s</td><td>0.02 s</td><td>0.13 s</td><td>0.94 s</td><td>0.05 s</td></tr>
<tr><td>Admin All Chats export</td><td>0.14 s</td><td>1.96 s</td><td>0.79 s</td><td>0.33 s</td><td>1.45 s</td><td>0.59 s</td></tr>
</table>

Fixes #35001
2026-11-25 03:39:28 +04:00
Classic298 af31059d16 fix: shared chat shows a sub-agent's report as raw text from the owner (#35011)
Someone reading a shared chat saw each sub-agent report, timer and message from another chat as a plain message from the chat's owner, showing the full machine-written report, where the owner sees a compact row such as "Sub-agent finished". A shared chat hides the private details of messages the reader did not write, and that also hid which kind of row each of these messages is. The reader now gets that kind and nothing else, so they see the same rows as the owner, and the same goes for a copy the reader makes of the shared chat.

Fixes #34998
2026-11-25 03:39:25 +04:00
Classic298 b3e5766a06 refac: check machine selection changes on shared chats (#34983)
Choosing a machine template on a chat someone else owns now needs access to that template yourself.
2026-11-25 03:10:47 +04:00
Classic298 a8e7ac3987 refac: single message updates keep other members' messages (#34980)
Single-message updates and message events are now refused for messages written by other chat members, matching how saving the whole chat already keeps them.
2026-11-25 03:07:06 +04:00
Classic298 d64df861a2 refac: only accept own folders as the new parent when moving a folder (#34978)
Moving a folder now only accepts a parent folder the user owns.
2026-11-25 03:01:50 +04:00
Classic298 a548e9d752 refac: normalize browser view page path before proxying (#34975)
The browser view route now normalizes the page path on its own before adding the session prefix, the same way file previews already do.
2026-11-25 03:00:13 +04:00
Timothy Jaeryang Baek 72184499b1 refac 2026-11-25 02:52:26 +04:00
Timothy Jaeryang Baek 9d19883f15 chore: format 2026-11-25 02:36:30 +04:00
Classic298 414340682e perf: long chats no longer rewrite the whole conversation on every message (#34689)
Every sent message, finished reply, regenerate, edit and saved follow-up rewrote the whole stored conversation, so long chats got slower with each turn, most of all on PostgreSQL. Messages now live only in the message table the app already keeps, and a change writes only the messages it touches. Chats open, share, export and import as before. API responses no longer carry the flat message list older clients saved next to the conversation, and the answers to pinning, archiving, sharing or moving a chat no longer repeat its messages. Existing chats are converted once during the upgrade, in batches that continue where they stopped if the upgrade is interrupted.

| 130 MB chat, instant test model | SQLite before | SQLite after | PostgreSQL before | PostgreSQL after |
| --- | --- | --- | --- | --- |
| Message accepted | 2.4 s | 0.20 s | 10.9 s | 0.32 s |
| Reply done | 4.9 s | 0.9 s | 22.5 s | 1.4 s |
| Regenerate done | 4.6 s | 0.9 s | 19.6 s | 1.4 s |
| Saving an edit | 3.7 s | 1.8 s | 5.8 s | 1.7 s |
| Opening the chat | 2.3 s | 0.9 s | 1.6 s | 1.2 s |
| Written to the database per message | 533 MB | 2 KB | 533 MB | 2 KB |

Fixes #34688
2026-11-25 02:34:37 +04:00
Timothy Jaeryang Baek a17581475a refac 2026-11-25 02:15:42 +04:00
Timothy Jaeryang Baek 8522af2d61 refac 2026-11-25 01:46:31 +04:00
Timothy Jaeryang Baek c37725b7a3 refac 2026-11-25 01:07:47 +04:00
Classic298 179991fc1a fix: saving a router model strips the trailing space from a pattern (#34957)
A pattern like "```|def |function " (the example in the docs) lost its trailing space when the router model was saved, from the dialog or through the API. "function" without a space after it then matched as well, so a message about "functionality" went to the model meant for code. Patterns are now saved exactly as typed, and a pattern saved before this needs its space typed again. Conditions saved through the API now keep their spaces as sent too.

Fixes #34898
2026-11-24 22:51:49 +04:00
Timothy Jaeryang Baek 680cd3a0f3 refac 2026-11-24 22:37:32 +04:00
Timothy Jaeryang Baek 98dc1e5460 refac 2026-11-24 22:30:13 +04:00
Timothy Jaeryang Baek f10d244d05 refac 2026-11-24 22:26:11 +04:00
Timothy Jaeryang Baek 1fbb42be97 refac 2026-11-24 22:11:32 +04:00
Timothy Jaeryang Baek 59c8184bf1 refac 2026-11-24 20:53:38 +04:00
Classic298 5d1c7d39d5 fix: system prompt is not prompt-cached on Responses API connections with custom model ids (#34802)
Responses API connections sent the system prompt as a developer message only when the model id looked like a newer OpenAI model. Azure deployments with a custom name and prefixed proxy ids like openai/gpt-6.2 still got it in the separate instructions field, which GPT-6.2 and later never cache, so the whole system prompt was billed at the full input price on every turn and every tool call. The system prompt now always goes out as a developer message in the conversation, which brings the Responses API connection to parity with OpenAI and follows the Open Responses spec. With ENABLE_RESPONSES_API_STATEFUL on, tool calls no longer send the system prompt again, because the provider already keeps that message from the first request.

Fixes #34801
2026-11-24 20:31:33 +04:00
Timothy Jaeryang Baek d22ab1251d refac 2026-11-24 20:24:18 +04:00
Timothy Jaeryang Baek 57c955a033 refac 2026-11-24 16:39:36 +04:00
Classic298 b21b90533e fix: chat search with View set to All takes minutes when many chats are shared (#34911)
Searching chats in the search dialog with View set to All went through every shared chat on the instance before checking whether the searcher may open it. On PostgreSQL it also read through the messages of all users' chats, only to drop the ones the searcher cannot open, so one search could run for minutes while holding database connections. Now the folders and shared chats the searcher can open are looked up first and only those are searched, which also speeds up Created by you. The results are the same as before, and a user who owns nearly every chat keeps today's speed.

Measured on PostgreSQL with 61,000 chats (640,000 messages) and 1,000 shared chats (410 MB), for one user who can open 1,400 chats and 300 shared chats and one who can open 7,500 chats and 400 shared chats.

<table>
<tr><th>search</th><th>1,400 chats before</th><th>after</th><th>7,500 chats before</th><th>after</th></tr>
<tr><td>All, empty</td><td>1.2 s</td><td>0.2 s</td><td>2.3 s</td><td>0.3 s</td></tr>
<tr><td>All, a common word</td><td>10.8 s</td><td>1.0 s</td><td>12.5 s</td><td>7.6 s</td></tr>
<tr><td>All, two words</td><td>18.2 s</td><td>1.4 s</td><td>20.8 s</td><td>14.3 s</td></tr>
<tr><td>All, a rare word</td><td>14.5 s</td><td>2.4 s</td><td>15 s</td><td>8.9 s</td></tr>
<tr><td>Created by you, a common word</td><td>0.04 s</td><td>0.04 s</td><td>7.0 s</td><td>0.15 s</td></tr>
<tr><td>Created by you, 14 words</td><td>1.6 s</td><td>0.19 s</td><td>3.9 s</td><td>1.8 s</td></tr>
</table>

Fixes #34903
2026-11-23 21:56:08 +04:00
Classic298 c35321f9a4 fix: every page reload fires a user updated event even when nothing changed (#34838)
Every page load sends the browser's timezone, and the server saved it and fired a user updated event each time, even when it was the timezone already stored. Webhooks and Event functions listening for that event got one per reload for every user. Now the timezone is only saved, and the event only fired, when it actually changes.

Fixes #34837
2026-11-23 20:14:12 +04:00
Classic298 765465eed1 fix: video generation without a first frame fails on servers that need multipart (#34681)
Text-only video requests reached OpenAI compatible servers form-urlencoded, so servers that only accept multipart for the create request could not read them and answered with a 400. They now go out as multipart, like requests with a first-frame image.

Fixes #34679
2026-11-23 20:13:37 +04:00
Classic298 639e25ae39 perf: stop downloading tool server and terminal specs on every request without Redis (#34856)
Without Redis, every tool list and every chat message that uses an OpenAPI tool server or a terminal downloaded the specs of all of them again and waited for each one, and an unreachable server added its full 10 second timeout every time. The specs loaded at startup and on saving the settings are now reused, the same way they are with Redis, and importing a config now refreshes them too, with or without Redis. A changed spec, or a server that was down at startup while others loaded, appears after saving the settings or a restart as with Redis, and when every server was down at startup each request still tries them again until one loads. In this test a terminal message still takes about 0.9 seconds because it reads the terminal's working directory and system prompt live on every message.

<table>
<tr><th>Servers answering in 300 ms</th><th>Before</th><th>After</th></tr>
<tr><td>Tool list (median of 10)</td><td>312 ms, 10 spec downloads</td><td>11 ms, 0</td></tr>
<tr><td>Chat message with a tool server</td><td>323 ms</td><td>33 ms</td></tr>
<tr><td>Tool list with one tool server unreachable</td><td>10988 ms</td><td>16 ms</td></tr>
<tr><td>Chat message with a terminal (median of 10)</td><td>1842 ms</td><td>934 ms</td></tr>
<tr><td>Chat message with a terminal while another is unreachable</td><td>11961 ms</td><td>932 ms</td></tr>
</table>

Fixes #34855
2026-11-23 19:03:06 +04:00
Classic298 2cfccb1cef fix: users see the default image for a router model shared with them (#34796)
A router model with its own profile image showed the default logo to every user it was shared with or made public for, and only admins saw the uploaded image. The image now follows the same access as the router model itself, so anyone who can see and chat with it in the model selector also sees its image, and users it is not shared with still get the default logo.

Fixes #34793
2026-11-23 18:40:04 +04:00
Timothy Jaeryang Baek c11a16f448 refac 2026-11-23 18:38:47 +04:00
Timothy Jaeryang Baek 1581377b69 refac 2026-11-23 18:38:06 +04:00
Timothy Jaeryang Baek b7ce1bd194 refac 2026-11-23 18:35:34 +04:00
Classic298 bdebc44c6e fix: knowledge base loses PDF pages when files are added in a batch (#34886)
Adding already processed files to a knowledge base through the batch add API gave the knowledge base a fresh split of each file's plain text. The chunks lost the page they came from and could run across pages, so citations showed no page and RAG_SOURCE_METADATA_KEYS had nothing to pass to the model. The batch add now copies each file's existing chunks and falls back to the file's text when those chunks are missing. The duplicate content check is unchanged.

Fixes #34876
2026-11-23 18:33:12 +04:00
Timothy Jaeryang Baek 74fad78f1c refac 2026-11-23 18:23:07 +04:00
Timothy Jaeryang Baek 464e83e414 refac 2026-11-23 16:21:00 +04:00
Timothy Jaeryang Baek 5697a0939a refac 2026-11-23 16:10:09 +04:00
Timothy Jaeryang Baek c3747e8449 refac 2026-11-23 15:06:29 +04:00
Timothy Jaeryang Baek c1f3b6fd1e refac 2026-11-23 03:29:58 +04:00
Timothy Jaeryang Baek e5b098c681 refac 2026-11-22 23:44:38 +04:00
Timothy Jaeryang Baek 53d741157b refac 2026-11-22 22:20:19 +04:00
Timothy Jaeryang Baek d711d12aad refac 2026-11-22 19:36:12 +04:00
Timothy Jaeryang Baek df6be8c3a1 refac 2026-11-22 17:13:34 +04:00
Timothy Jaeryang Baek 3f54f781be refac 2026-11-22 16:34:32 +04:00