Repository navigation
Commit aca5b31
committed
fix(api): race requesty request creation against its cancellation scope
createMessage awaited the SDK create() call directly at requesty.ts:242 while
the same file documents, at 377-382, that [email protected] does not observe the
signal inside retryRequest - it sleeps for the backoff, or a server-provided
retry-after-ms of up to about a minute, before the next attempt. completePrompt
races that await (383-385) and fetchModel is raced too (215, 346); request
creation was the provider's only unraced SDK await, so an abort during a retry
backoff left createMessage pending for the length of the sleep. Wrap it in the
same rejectOnAbort race and add a row whose mockCreate never settles, which is
the shape that hung before this change: with the two production lines reverted
the new row fails with 'settle guard timed out after 500ms' and the other 76
pass.1 parent 39202fe commit aca5b31
2 files changed
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1169 | 1169 | | |
1170 | 1170 | | |
1171 | 1171 | | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1172 | 1204 | | |
1173 | 1205 | | |
1174 | 1206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
243 | 250 | | |
244 | 251 | | |
245 | 252 | | |
| |||
0 commit comments