Repository navigation
Commit 3c51b63
committed
fix(api): handle vscode-lm createMessage aborts during client init and streaming
- createMessage re-checks the external abort signal after client initialization
(and before sendRequest), cancelling the local token source and throwing an
AbortError when the signal aborted while getClient() was pending
- createMessage re-checks the external abort signal at the top of the stream
consumption loop so a late abort stops the stream instead of yielding stale
chunks (the bridged listener still covers the normal mid-flight case)
- spec: the mid-flight abort test now expects the stream to stop with an
AbortError; added a regression test where client initialization is gated on a
release promise and the signal aborts in that window - the generator rejects
with AbortError and sendRequest is never called1 parent 00249a6 commit 3c51b63
2 files changed
Lines changed: 57 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
511 | 548 | | |
512 | 549 | | |
513 | 550 | | |
| |||
537 | 574 | | |
538 | 575 | | |
539 | 576 | | |
540 | | - | |
| 577 | + | |
| 578 | + | |
541 | 579 | | |
542 | 580 | | |
543 | | - | |
| 581 | + | |
544 | 582 | | |
545 | 583 | | |
546 | 584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
425 | 435 | | |
426 | 436 | | |
427 | 437 | | |
| |||
436 | 446 | | |
437 | 447 | | |
438 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
439 | 456 | | |
440 | 457 | | |
441 | 458 | | |
| |||
0 commit comments