Commit 7310c06
improvement(mothership): table speed parity — keyset reads, limit bounds, background import/delete jobs
Mothership's table operations lagged the fast paths the tables feature
already has:
- function_execute mounted inputTables via queryRows with defaults,
silently truncating the sandbox CSV to 100 rows and paying for a count
and execution metadata it never used. Mounts now drain the keyset
export reader page by page, remap stored column-id keys to display
names (headers previously didn't match id-keyed cell data), mount
tables in parallel, and count toward the 50MB sandbox mount budget.
- user_table query_rows accepted unbounded limits (whole table into one
tool result) and only offset paging. It now enforces the contracts'
MAX_QUERY_LIMIT, skips execution metadata, accepts the keyset `after`
cursor, and returns `nextCursor` when a default-order page fills.
- import_file / create_from_file / delete_rows_by_filter mutated without
claiming the per-table job slot, racing running background jobs, and
ran whole imports inline in the chat request. CSV/TSV imports ≥8MB and
unbounded filter-deletes matching >1000 rows now dispatch the same
trigger.dev jobs the UI routes use (slot claim, release-on-dispatch-
failure, delete mask); inline imports claim and release the slot. A new
get_job operation surfaces the table's derived job state for polling.
- TableImportPayload grows deleteSourceFile (default true) so Mothership
imports of persistent workspace files survive the worker's single-use
source cleanup.
Generated tool catalog artifacts regenerated from simstudioai/copilot#289.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 2626482 commit 7310c06
8 files changed
Lines changed: 1140 additions & 106 deletions
File tree
- apps/sim/lib
- copilot
- generated
- tools
- handlers
- server/table
- table
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3868 | 3868 | | |
3869 | 3869 | | |
3870 | 3870 | | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
3871 | 3887 | | |
3872 | 3888 | | |
3873 | 3889 | | |
| |||
3956 | 3972 | | |
3957 | 3973 | | |
3958 | 3974 | | |
3959 | | - | |
| 3975 | + | |
| 3976 | + | |
3960 | 3977 | | |
3961 | 3978 | | |
3962 | 3979 | | |
| |||
4009 | 4026 | | |
4010 | 4027 | | |
4011 | 4028 | | |
4012 | | - | |
| 4029 | + | |
| 4030 | + | |
4013 | 4031 | | |
4014 | 4032 | | |
4015 | 4033 | | |
| |||
4146 | 4164 | | |
4147 | 4165 | | |
4148 | 4166 | | |
| 4167 | + | |
4149 | 4168 | | |
4150 | 4169 | | |
4151 | 4170 | | |
| |||
4524 | 4543 | | |
4525 | 4544 | | |
4526 | 4545 | | |
| 4546 | + | |
4527 | 4547 | | |
4528 | 4548 | | |
4529 | 4549 | | |
| |||
4560 | 4580 | | |
4561 | 4581 | | |
4562 | 4582 | | |
| 4583 | + | |
4563 | 4584 | | |
4564 | 4585 | | |
4565 | 4586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3598 | 3598 | | |
3599 | 3599 | | |
3600 | 3600 | | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
3601 | 3617 | | |
3602 | 3618 | | |
3603 | 3619 | | |
| |||
3694 | 3710 | | |
3695 | 3711 | | |
3696 | 3712 | | |
3697 | | - | |
| 3713 | + | |
| 3714 | + | |
3698 | 3715 | | |
3699 | 3716 | | |
3700 | 3717 | | |
| |||
3753 | 3770 | | |
3754 | 3771 | | |
3755 | 3772 | | |
3756 | | - | |
| 3773 | + | |
| 3774 | + | |
3757 | 3775 | | |
3758 | 3776 | | |
3759 | 3777 | | |
| |||
3902 | 3920 | | |
3903 | 3921 | | |
3904 | 3922 | | |
| 3923 | + | |
3905 | 3924 | | |
3906 | 3925 | | |
3907 | 3926 | | |
| |||
Lines changed: 135 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
65 | 106 | | |
66 | 107 | | |
67 | 108 | | |
| |||
247 | 288 | | |
248 | 289 | | |
249 | 290 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
256 | 310 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
272 | 314 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
288 | 322 | | |
289 | 323 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 324 | + | |
| 325 | + | |
299 | 326 | | |
300 | 327 | | |
301 | 328 | | |
| |||
0 commit comments