Commit d1b7738
committed
fix(sdk): stop chat.createSession wedging on stop and erroring on continuation boots
turn.complete() bare-awaited the AI SDK's totalUsage promise, which
never settles after a stop-abort: the run wedged inside the stopped
turn and the chat could never take another message. Now raced with a
2s timeout, the same guard chat.agent's turn loop uses.
createSession's first turn only waited for a message on preload boots.
Continuation runs (spawned after a cancel, crash, or upgrade) arrive
with the boot payload stripped, so the loop invoked the model with an
empty prompt and the turn errored. Message-less continuation boots now
wait for the next session input, and the continuation flag is preserved
so user code can seed stored history off turn.continuation.1 parent 954ee5c commit d1b7738
2 files changed
Lines changed: 37 additions & 8 deletions
| 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 | |
|---|---|---|---|
| |||
8988 | 8988 | | |
8989 | 8989 | | |
8990 | 8990 | | |
8991 | | - | |
8992 | | - | |
| 8991 | + | |
| 8992 | + | |
| 8993 | + | |
| 8994 | + | |
| 8995 | + | |
| 8996 | + | |
| 8997 | + | |
| 8998 | + | |
8993 | 8999 | | |
8994 | 9000 | | |
8995 | 9001 | | |
8996 | 9002 | | |
8997 | | - | |
| 9003 | + | |
| 9004 | + | |
| 9005 | + | |
| 9006 | + | |
8998 | 9007 | | |
8999 | 9008 | | |
9000 | 9009 | | |
9001 | 9010 | | |
9002 | 9011 | | |
| 9012 | + | |
9003 | 9013 | | |
| 9014 | + | |
| 9015 | + | |
| 9016 | + | |
| 9017 | + | |
| 9018 | + | |
| 9019 | + | |
9004 | 9020 | | |
9005 | 9021 | | |
9006 | 9022 | | |
| |||
9170 | 9186 | | |
9171 | 9187 | | |
9172 | 9188 | | |
9173 | | - | |
| 9189 | + | |
| 9190 | + | |
| 9191 | + | |
| 9192 | + | |
9174 | 9193 | | |
9175 | 9194 | | |
9176 | 9195 | | |
9177 | | - | |
9178 | | - | |
9179 | | - | |
9180 | | - | |
| 9196 | + | |
| 9197 | + | |
| 9198 | + | |
| 9199 | + | |
| 9200 | + | |
| 9201 | + | |
| 9202 | + | |
| 9203 | + | |
| 9204 | + | |
9181 | 9205 | | |
9182 | 9206 | | |
9183 | 9207 | | |
| |||
0 commit comments