Ethan
d8e3f4fcf7
feat: evict the oldest attachments at the chat file cap ( #29063 )
...
Closes CODAGT-933
Long agent sessions were hitting the 50 attachment cap, after which
every upload, screenshot and `attach_file` call was rejected, so people
were abandoning otherwise healthy chats.
Rather than raise the cap (which just moves the cliff and multiplies the
worst-case per-chat `bytea` storage), a chat now keeps its 50 most
recent attachments. `LinkChatFilesAfterLock` deletes the oldest
`chat_files` rows in the same statement and the cascade drops their
links. Files in the incoming batch are never evicted, so the only
remaining rejection is a single message with more than 50 files.
Nothing in the product ever linked one file to two chats, so rather than
guard the eviction against it, this adds `UNIQUE (file_id)` on
`chat_file_links`, with the migration dropping any existing duplicates
in favour of the oldest chat.
Evicted attachments render as the existing "Attachment expired" tile. A
`pinned` flag is the obvious follow-up if someone needs to keep a
specific file around.
2026-09-10 13:40:16 +10:00
..
2026-07-14 13:50:25 +01:00
2026-08-20 20:54:52 +00:00
2026-09-05 11:39:10 +02:00
2026-08-24 17:09:00 +02:00
2026-08-05 22:41:17 +02:00
2026-09-08 09:31:42 -04:00
2026-09-05 11:39:10 +02:00
2026-09-05 11:39:10 +02:00
2026-09-05 11:39:10 +02:00
2026-09-05 11:39:10 +02:00
2026-06-16 12:35:40 +00:00
2026-09-10 13:40:16 +10:00
2026-09-05 11:39:10 +02:00
2026-09-05 11:39:10 +02:00
2026-07-02 11:22:56 +01:00
2026-08-30 13:09:17 +02:00
2026-08-25 16:57:27 +07:00
2026-07-29 11:39:12 +00:00
2026-08-27 10:22:33 +02:00
2026-08-27 10:22:33 +02:00
2026-08-26 11:57:56 -06:00
2026-08-18 16:55:43 +02:00
2026-08-18 16:55:43 +02:00
2026-08-18 16:55:43 +02:00
2026-09-10 13:40:16 +10:00
2026-09-05 11:39:10 +02:00
2026-07-06 16:37:45 +00:00
2026-07-06 16:37:45 +00:00
2026-08-18 16:55:43 +02:00
2026-08-20 20:54:52 +00:00
2026-09-05 11:39:10 +02:00
2026-09-05 11:39:10 +02:00
2026-08-25 11:35:53 +02:00
2026-09-10 13:40:16 +10:00
2026-09-05 11:39:10 +02:00
2026-05-08 02:07:33 +10:00
2026-07-20 19:49:19 +02:00
2026-07-29 11:39:12 +00:00
2026-08-24 11:20:26 +01:00
2026-08-24 11:20:26 +01:00
2026-08-04 08:00:19 +00:00
2026-08-04 08:00:19 +00:00
2026-08-20 20:54:52 +00:00
2026-08-24 11:20:26 +01:00
2026-08-24 11:20:26 +01:00
2026-09-02 13:38:14 +02:00
2026-09-02 13:38:14 +02:00
2026-09-02 13:38:14 +02:00
2026-08-20 15:56:58 +02:00
2026-08-19 08:51:25 -05:00
2026-08-24 15:36:32 -07:00
2026-07-29 11:39:12 +00:00
2026-06-11 16:08:32 +10:00
2026-06-11 16:08:32 +10:00
2026-05-20 01:37:38 +02:00
2026-08-26 13:33:13 +02:00
2026-07-29 11:39:12 +00:00
2026-08-26 11:57:56 -06:00
2026-09-08 09:31:42 -04:00
2026-06-17 10:20:47 +00:00
2026-09-08 09:31:42 -04:00
2026-08-24 09:30:01 +00:00
2026-07-29 11:39:12 +00:00
2026-08-05 22:41:17 +02:00
2026-09-05 11:39:10 +02:00
2026-06-26 13:41:43 +03:00
2026-06-22 19:26:34 -06:00
2026-07-18 20:45:13 +02:00
2026-08-26 11:57:56 -06:00
2026-06-16 12:35:40 +00:00
2026-08-30 13:09:17 +02:00
2026-08-18 19:12:47 +02:00
2026-08-18 19:12:47 +02:00
2026-09-05 11:39:10 +02:00
2026-09-08 09:31:42 -04:00
2026-09-08 09:31:42 -04:00
2026-09-09 18:28:57 +01:00
2026-09-09 18:28:57 +01:00
2026-08-20 20:54:52 +00:00
2026-08-24 11:20:25 +01:00
2026-09-05 11:39:10 +02:00
2026-08-18 16:55:43 +02:00
2026-07-29 11:39:12 +00:00
2026-07-29 11:39:12 +00:00
2026-06-26 13:41:43 +03:00
2026-09-08 09:31:42 -04:00
2026-08-24 11:20:25 +01:00
2026-08-25 17:56:30 +00:00
2026-08-26 11:57:56 -06:00
2026-09-10 13:40:16 +10:00
2026-04-22 20:11:53 +10:00
2026-06-12 13:33:12 +02:00
2026-07-29 11:39:12 +00:00
2026-07-29 11:39:12 +00:00
2026-07-29 11:39:12 +00:00
2026-09-10 13:40:16 +10:00
2026-09-10 13:40:16 +10:00
2026-06-12 13:33:12 +02:00
2026-06-12 13:33:12 +02:00
2026-06-12 13:33:12 +02:00
2026-06-16 12:35:40 +00:00
2026-06-18 08:28:17 +00:00
2026-06-12 13:33:12 +02:00
2026-06-12 13:33:12 +02:00
2026-06-12 13:33:12 +02:00
2026-06-12 13:33:12 +02:00
2026-09-04 08:55:15 +01:00
2026-06-12 13:33:12 +02:00
2026-09-05 11:39:10 +02:00
2026-07-18 20:45:13 +02:00
2026-09-05 11:39:10 +02:00
2026-07-18 20:45:13 +02:00
2026-09-05 11:39:10 +02:00
2026-07-27 10:05:05 +01:00
2026-07-20 19:49:19 +02:00
2026-07-18 20:45:13 +02:00
2026-09-05 11:39:10 +02:00
2026-08-25 17:29:57 +07:00
2026-06-17 18:29:43 +02:00
2026-09-05 11:39:10 +02:00
2026-08-24 11:20:26 +01:00
2026-08-25 16:57:27 +07:00
2026-08-25 16:57:27 +07:00
2026-08-24 09:30:01 +00:00
2026-09-05 11:39:10 +02:00
2026-09-05 11:39:10 +02:00