Commit Graph
2092 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 7aa18c48fe refac 2026-11-20 21:51:19 +04:00
Timothy Jaeryang Baek 8fb2bf35ad refac 2026-11-19 19:13:33 +04:00
Timothy Jaeryang Baek 43d7281f4e refac 2026-11-18 18:55:30 +04:00
Timothy Jaeryang Baek 10be890bce refac 2026-11-17 23:28:54 +09:00
Timothy Jaeryang Baek 916c03829d chore: format 2026-11-17 22:37:26 +09:00
Timothy Jaeryang Baek c48832a6d4 refac 2026-11-17 22:28:32 +09:00
Timothy Jaeryang Baek 207c7735f4 refac 2026-11-17 22:24:21 +09:00
Classic298 aca79d17b2 perf: keep the server responsive while a knowledge base is exported (#34600)
Exporting a knowledge base packed and compressed all of its files while holding up the worker process serving it, so every other request on that worker (chats, page loads, health checks) waited until the archive was done. With several exports running at once, other users saw pauses of more than a second. The download still waits for the archive, but the server now keeps answering everyone else while it is packed. In our test the worst pause dropped from about 1.3 seconds to about 0.4 seconds, and the downloaded file is unchanged.

| 200 files of ~60 KB, 10 exports at once, worst of 2 runs | before | after |
| --- | --- | --- |
| slowest health check while exporting | 1328 ms | 403 ms |

Fixes #34599
2026-11-17 22:19:48 +09:00
Classic298 0f54aee859 perf: large profile pictures and knowledge exports load much faster (#34598)
Large profile pictures of users, models and channel webhooks (animated ones, or ones set through the API) were sent out in thousands of small pieces, each handled separately, and the knowledge base export sent its zip file the same way. A 2 MB picture took around 200 to 400 ms to load, 20 loads of it at once, as on a page full of avatars, took 9 to 15 seconds, and an 8 MB export spent close to a second just sending the file. Both are now sent as one complete response with the same content type and headers, plus a size header in place of chunked sending.

| Picture | One load before | One load after | 20 at once before | 20 at once after |
| --- | --- | --- | --- | --- |
| Model, 2 MB | 207 ms | 15 ms | 9.3 s | 0.48 s |
| User, 2 MB | 379 ms | 15 ms | 15.0 s | 0.34 s |
| Model, 5 MB | 743 ms | 39 ms | 33.6 s | 0.63 s |
| User, 5 MB | 627 ms | 25 ms | 30.7 s | 0.54 s |

Fixes #34597
2026-11-17 22:18:51 +09:00
Classic298 f06b8b35ad fix: uploads stall behind a knowledge base sync waiting on a slow extraction engine (#34379)
* fix: uploads stall behind a knowledge base sync waiting on a slow extraction engine

Every uploaded file started processing at once, and each file waiting on the extraction engine used up one of the server's limited worker slots, the same slots that save new uploads to storage. With a slow extraction engine a large knowledge base sync used up all of them, so every new upload, chat attachments included, had to wait for an extraction to finish before it was even saved. Files uploaded into a knowledge base now process at most half as many at a time as there are slots, and the rest wait their turn without using one, so other users' knowledge base uploads may wait too during a large sync. Chat attachments and all other uploads skip this line and process right away, as before. Measured with an extraction engine limited to one connection and 50 files synced into a knowledge base, uploads stayed under 0.1 s instead of taking up to 4 s, a chat attachment sent meanwhile was ready in 20 s instead of 42 s, and the sync took the same time.

Related to #34369

* Size the knowledge upload limit inline and type it

* Ignore an invalid thread pool size like the server does
2026-11-17 22:17:12 +09:00
Timothy Jaeryang Baek b462a23a70 refac 2026-11-17 20:34:05 +09:00
Timothy Jaeryang Baek 1b2c6da879 refac 2026-11-17 20:28:26 +09:00
Timothy Jaeryang Baek c041c98220 refac 2026-11-17 19:59:57 +09:00
Classic298 f3660788ab fix: OAuth session limit drops a device still in use after sign-outs elsewhere (#34586)
Signing out left the browser's stored OAuth session in place, and once a person reached OAUTH_MAX_SESSIONS_PER_USER the next sign-in removed the sessions created first. A device signed in early and still in use lost its session to ones from browsers that had already signed out. Signing out now removes that browser's stored session when the person still has another one for the same provider, and the limit removes the sessions that were signed in or refreshed least recently. A person's only session stays after sign-out, because automations and API key calls keep using it.

Fixes #34581
2026-11-17 19:32:44 +09:00
Timothy Jaeryang Baek c201472cf8 refac 2026-11-17 19:31:57 +09:00
Timothy Jaeryang Baek 3349606652 refac 2026-11-17 19:13:47 +09:00
Timothy Jaeryang Baek e1d2722520 refac 2026-11-17 18:48:38 +09:00
Timothy Jaeryang Baek c68b8a632e refac 2026-11-17 17:02:34 +09:00
Timothy Jaeryang Baek dfc68aa212 refac 2026-11-17 14:06:14 +09:00
Timothy Jaeryang Baek 5ddd419539 refac 2026-11-17 13:58:25 +09:00
Timothy Jaeryang Baek 587aba0383 refac 2026-11-17 13:48:08 +09:00
Timothy Jaeryang Baek 988708b8ee refac 2026-11-17 01:58:43 +09:00
Classic298 3a1a993981 fix: MCP OAuth 2.1 setup fails when the auth server sends very large response headers (#34084)
* fix: MCP OAuth 2.1 setup fails when the auth server sends very large response headers

Adding an MCP server with OAuth 2.1 failed with "Connection error" when its authorization server sent a single response header over 8 KB, which monday.com does with an 11 KB Content-Security-Policy on every OAuth endpoint. Setting up these servers and refreshing their tokens now works, with single headers accepted up to 64 KB.

Fixes #34078

* fix: raise the MCP OAuth header limit only where setup needs it

The check that runs before client registration already moves on when it cannot read a response, so it keeps the default header limit. The larger limit now stays on the requests that broke setup and token refresh.
2026-11-16 22:42:48 +09:00
Timothy Jaeryang Baek 205c2e97ce refac 2026-11-16 21:10:30 +09:00
Timothy Jaeryang Baek abcebd7d0d refac 2026-11-16 20:02:16 +09:00
Classic298 956ee485f9 fix: concurrent requests stall for 30 seconds and fail with database session sharing on (#34185)
With DATABASE_ENABLE_SESSION_SHARING on (off by default), the chat lists and the inbox held the request's database connection while they opened a second one for a small extra read. A burst of page loads then took every pooled connection, each request waited for a second connection, and they failed after the 30 second pool timeout with "QueuePool limit ... reached". Those extra reads now run on the request's own connection. In a burst of 80 page loads with a pool of 5, 11 failed on SQLite and 58 on PostgreSQL before this change, and none fail now.

Fixes #34184
2026-11-16 19:15:17 +09:00
Classic298 720b72a96c fix: admin user list API returns empty groups for every user (#34489)
The admin endpoint that lists all users (GET /api/v1/users/all) always returned "groups": [] for every user, even for users who belong to groups. It now lists each user's groups by id and name, like the single user info endpoint.

Fixes #26156
2026-11-16 15:37:33 +09:00
Classic298 bf04d75cfd fix: OpenAI clients get a 400 from the Ollama proxy after a tool call (#34442)
OpenAI-compatible clients and SDKs leave out the text field on an assistant turn that only carries tool calls, which the OpenAI format allows. The Ollama OpenAI-compatible chat endpoint refused that turn with a 400 "Field required", so multi-turn tool calling broke as soon as the client sent the history back. Such turns are now accepted and passed on to Ollama as sent.

Fixes #34441
2026-11-16 15:29:13 +09:00
Timothy Jaeryang Baek a199370769 refac 2026-11-16 15:16:21 +09:00
Timothy Jaeryang Baek f22671e35a refac 2026-11-16 13:15:49 +09:00
Timothy Jaeryang Baek 31ef2064da refac 2026-11-15 16:56:45 +09:00
Classic298 7a73f1960f fix: terminal files fail to load on a Tether reconnect instead of being retried (#34396)
When the computer connected through Tether reconnected while the terminal's files panel was loading its working folder, a folder listing or a file, the load failed with "Tether connection interrupted". Reads like these are meant to be retried once Tether is back. They never were, because each of them went out with an empty upload attached, and an upload cannot be sent a second time. Requests with nothing to upload now go without one, so these reads are retried on the new connection. Uploads work as before.

Fixes #34394
2026-11-14 06:40:44 +09:00
Timothy Jaeryang Baek 694dc9796c refac 2026-11-14 01:15:47 +09:00
Timothy Jaeryang Baek 6378f94a65 refac 2026-11-14 00:45:43 +09:00
Timothy Jaeryang Baek f1d735d807 refac 2026-11-13 23:50:28 +09:00
Timothy Jaeryang Baek 06491f0132 refac 2026-11-13 22:40:53 +09:00
Timothy Jaeryang Baek 4720ff19e7 refac 2026-11-13 17:36:00 +09:00
Timothy Jaeryang Baek c67d774d71 refac 2026-11-12 22:17:23 +09:00
Classic298 408e89d7e8 fix: Browser tab in Chrome mode keeps reconnecting when its chat is open in two windows (#34133)
* fix: Browser tab in Chrome mode keeps reconnecting when its chat is open in two windows

With the same chat open in two windows, the terminal hands the Chrome tab to the newer window, but the older window only saw a lost connection. It reconnected and took the tab back, so both windows kept flipping to "Reconnecting…" and the "Browser opened in another viewer." message never showed. The terminal's reason for ending the tab's connection now reaches the page, as it already does for the shell. The window that lost the tab shows that message and stops, and the other window keeps the page.

Fixes #34095

* fix: Browser tab in Chrome mode keeps reconnecting when its chat is open in two windows

Narrows the change to passing the terminal's close reason on to the page. The relay's existing handling of a broken connection stays as it was.
2026-11-12 22:00:12 +09:00
Timothy Jaeryang Baek edecad351b refac 2026-11-12 21:28:52 +09:00
Timothy Jaeryang Baek 2547992b8a refac 2026-11-12 13:39:35 +09:00
Classic298 2c8fa823f3 feat: permission to limit sub-agents to specific users and groups (#34040)
Sub-agents could only be switched on or off for the whole instance, so once they were on every user could spawn them and an admin had no way to keep the extra model usage to a pilot group. The user permissions now have a Sub-agents switch under Features, both in the default permissions and in each group, next to Memories and working the same way. Users without the permission no longer get the sub-agent tool in their chats, nor the timer tool that is part of the same feature. Admins are not restricted by it, and with sub-agents off in Admin Settings nobody gets them, admins included. The permission is on by default, so existing instances behave as before until an admin turns it off; the default can also be set with the USER_PERMISSIONS_FEATURES_SUBAGENTS environment variable.

Closes #34038
2026-11-11 10:11:30 +09:00
Timothy Jaeryang Baek c647f3f42e refac 2026-11-10 23:38:17 +09:00
Timothy Jaeryang Baek 2975bf8e42 refac 2026-11-10 23:02:00 +09:00
Timothy Jaeryang Baek f4cf2ca0c7 refac 2026-11-10 22:56:33 +09:00
Timothy Jaeryang Baek 6f2fc7bc7a refac 2026-11-10 21:18:18 +09:00
Timothy Jaeryang Baek 98f94057bb refac 2026-11-10 13:05:45 +09:00
Timothy Jaeryang Baek 354c652fc9 refac 2026-11-10 12:13:49 +09:00
Timothy Jaeryang Baek 553b18a34d refac 2026-11-09 16:04:13 +09:00
Timothy Jaeryang Baek 62849662d9 refac 2026-11-09 15:55:13 +09:00