Repository navigation
Commit 00249a6
committed
fix(api): address CodeRabbit review on vscode-lm abort handling
- createMessage: sendRequest now uses the request-local cancellation source, the
finally block disposes that local source and clears the shared field only when it
still points at this request, and the error path no longer calls ensureCleanState
(prevents an older finishing request from cancelling/disposing a newer request's
token)
- completePrompt: a pre-aborted signal now fails fast before getClient() and again
before sendRequest(), so a cancelled request never initializes or invokes the host
- completePrompt: a host vscode.CancellationError is normalized to an AbortError
alongside isAborted()
- spec: the timeout test now expects an AbortError (the cancelled token aborts the
completion); the pre-abort test asserts sendRequest is never called; added a
CancellationError -> AbortError rejection test; the mock CancellationTokenSource
cancel() now flips isCancellationRequested to match the real API1 parent c9753bf commit 00249a6
2 files changed
Lines changed: 58 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
1220 | 1225 | | |
1221 | 1226 | | |
1222 | 1227 | | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | 1228 | | |
1238 | 1229 | | |
1239 | 1230 | | |
| |||
1242 | 1233 | | |
1243 | 1234 | | |
1244 | 1235 | | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1248 | 1239 | | |
1249 | 1240 | | |
1250 | 1241 | | |
| |||
1309 | 1300 | | |
1310 | 1301 | | |
1311 | 1302 | | |
1312 | | - | |
1313 | | - | |
| 1303 | + | |
| 1304 | + | |
1314 | 1305 | | |
1315 | | - | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
1316 | 1309 | | |
1317 | 1310 | | |
1318 | 1311 | | |
| |||
1361 | 1354 | | |
1362 | 1355 | | |
1363 | 1356 | | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
1364 | 1370 | | |
1365 | 1371 | | |
1366 | 1372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
508 | | - | |
509 | | - | |
510 | 508 | | |
511 | 509 | | |
512 | 510 | | |
| |||
543 | 541 | | |
544 | 542 | | |
545 | 543 | | |
546 | | - | |
547 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
548 | 550 | | |
549 | 551 | | |
550 | 552 | | |
| |||
628 | 630 | | |
629 | 631 | | |
630 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
631 | 641 | | |
632 | 642 | | |
633 | 643 | | |
| |||
661 | 671 | | |
662 | 672 | | |
663 | 673 | | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
664 | 682 | | |
665 | 683 | | |
666 | 684 | | |
| |||
684 | 702 | | |
685 | 703 | | |
686 | 704 | | |
687 | | - | |
688 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
689 | 709 | | |
690 | 710 | | |
691 | 711 | | |
| |||
0 commit comments