Repository navigation
Commit cb3ff96
committed
fix(desktop): hand a device its calls in the order they were persisted
The inbox ordered calls by created_at, then tool_call_id. Calls of one turn
can be persisted in the same millisecond, and then the tie broke on random
ids: a device could run a click before the type the model emitted first.
Calls now carry persist_seq, a strictly increasing number assigned on insert
(pre-persist writes them in emission order), and the inbox and the overdue
sweep order by it. The migration adds the column without a default and then
sets the default, so existing rows are not rewritten; rows persisted before it
have no position and sort first, as the oldest.1 parent ea6cd54 commit cb3ff96
7 files changed
Lines changed: 30287 additions & 7 deletions
File tree
- apps/sim/lib/desktop
- application
- executor
- packages
- db
- migrations
- meta
- testing/src/mocks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
868 | 890 | | |
869 | 891 | | |
870 | 892 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
87 | 110 | | |
88 | 111 | | |
89 | 112 | | |
| |||
178 | 201 | | |
179 | 202 | | |
180 | 203 | | |
181 | | - | |
| 204 | + | |
182 | 205 | | |
183 | 206 | | |
184 | 207 | | |
| |||
192 | 215 | | |
193 | 216 | | |
194 | 217 | | |
| 218 | + | |
195 | 219 | | |
196 | 220 | | |
197 | 221 | | |
| |||
208 | 232 | | |
209 | 233 | | |
210 | 234 | | |
211 | | - | |
| 235 | + | |
212 | 236 | | |
213 | 237 | | |
214 | 238 | | |
| |||
228 | 252 | | |
229 | 253 | | |
230 | 254 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 255 | + | |
235 | 256 | | |
236 | 257 | | |
237 | 258 | | |
| |||
428 | 449 | | |
429 | 450 | | |
430 | 451 | | |
431 | | - | |
| 452 | + | |
432 | 453 | | |
433 | 454 | | |
434 | 455 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments