Commit 6aeb2b9
committed
fix(sdk): clean incomplete parts from the recovered error partial
Apply cleanupAbortedParts to the partial recovered on a source-stream failure,
in both the managed and manual loops. A transport error leaves the same
incomplete-part state as a user stop (streaming text not finalized, dangling
tool calls), so the partial is cleaned the same way: text is kept and
unfinished tool parts are dropped, keeping the persisted UI history and the
model view consistent. Also reset the error event's newMessages delta when the
model-message conversion fails, so it can't advertise messages that were rolled
back.1 parent ec33b97 commit 6aeb2b9
2 files changed
Lines changed: 53 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7936 | 7936 | | |
7937 | 7937 | | |
7938 | 7938 | | |
| 7939 | + | |
| 7940 | + | |
| 7941 | + | |
7939 | 7942 | | |
7940 | 7943 | | |
7941 | 7944 | | |
| |||
7999 | 8002 | | |
8000 | 8003 | | |
8001 | 8004 | | |
| 8005 | + | |
8002 | 8006 | | |
8003 | 8007 | | |
8004 | 8008 | | |
| |||
9840 | 9844 | | |
9841 | 9845 | | |
9842 | 9846 | | |
9843 | | - | |
9844 | | - | |
9845 | | - | |
9846 | | - | |
9847 | | - | |
9848 | | - | |
9849 | | - | |
9850 | | - | |
9851 | | - | |
9852 | 9847 | | |
9853 | | - | |
| 9848 | + | |
9854 | 9849 | | |
9855 | 9850 | | |
9856 | 9851 | | |
| |||
Lines changed: 48 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
57 | | - | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
322 | 368 | | |
323 | 369 | | |
324 | 370 | | |
| |||
0 commit comments