Commit 51ff968
committed
fix(sdk): recover the in-flight message on a preloaded chat.agent retry
A preloaded chat.agent run (started via transport.preload) that retried after an out-of-memory error dropped the message it was processing at crash time. Boot recovery restores the in-flight message into the dispatch queue and advances the .in cursor past it, but the preload branch fired onPreload and waited for a first message without draining that queue, so the recovered message was stranded behind the advanced cursor and the run sat waiting. The preload branch now dispatches a recovered message as the first turn before waiting.
Includes a full-stack e2e that reproduces the drop (preloaded run, OOM on attempt 1, in-flight message on .in) and passes with the fix.1 parent 8c75caf commit 51ff968
3 files changed
Lines changed: 20 additions & 3 deletions
File tree
- .changeset
- apps/webapp/test
- packages/trigger-sdk/src/v3
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1415 | 1415 | | |
1416 | 1416 | | |
1417 | 1417 | | |
1418 | | - | |
| 1418 | + | |
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
| |||
1456 | 1456 | | |
1457 | 1457 | | |
1458 | 1458 | | |
1459 | | - | |
1460 | 1459 | | |
1461 | 1460 | | |
1462 | 1461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6062 | 6062 | | |
6063 | 6063 | | |
6064 | 6064 | | |
| 6065 | + | |
| 6066 | + | |
| 6067 | + | |
| 6068 | + | |
| 6069 | + | |
| 6070 | + | |
| 6071 | + | |
| 6072 | + | |
| 6073 | + | |
| 6074 | + | |
| 6075 | + | |
| 6076 | + | |
| 6077 | + | |
6065 | 6078 | | |
6066 | | - | |
| 6079 | + | |
6067 | 6080 | | |
6068 | 6081 | | |
6069 | 6082 | | |
| |||
0 commit comments