Commit af745f8
committed
🤖 fix: emit stream-error for pre-stream API failures
When sendMessage failed before the stream started (e.g., invalid model,
API key missing), the error was only shown as a toast which could be
easily missed. The user would see their message in the chat but no
response, with no indication of what went wrong.
Now, when streamWithHistory fails, we emit a stream-error chat event
so the error is visible directly in the conversation. This provides
clear feedback when:
- Model validation fails (invalid format, non-existent model)
- API key is not configured
- Provider is not supported
- Any other pre-stream error
The toast is still shown for immediate feedback, but the stream-error
ensures the error is also visible in the chat history.
_Generated with mux_1 parent b2e8690 commit af745f8
File tree
2 files changed
+65
-6
lines changed- src/node/services
- tests/ipc
2 files changed
+65
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
430 | | - | |
431 | | - | |
| 433 | + | |
| 434 | + | |
432 | 435 | | |
| 436 | + | |
| 437 | + | |
433 | 438 | | |
434 | 439 | | |
435 | 440 | | |
| |||
483 | 488 | | |
484 | 489 | | |
485 | 490 | | |
486 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
487 | 494 | | |
488 | 495 | | |
489 | 496 | | |
490 | 497 | | |
491 | | - | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
492 | 501 | | |
493 | 502 | | |
494 | 503 | | |
| |||
497 | 506 | | |
498 | 507 | | |
499 | 508 | | |
500 | | - | |
| 509 | + | |
501 | 510 | | |
502 | 511 | | |
503 | 512 | | |
| |||
509 | 518 | | |
510 | 519 | | |
511 | 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 | + | |
512 | 547 | | |
513 | 548 | | |
514 | 549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
99 | 123 | | |
100 | 124 | | |
101 | 125 | | |
| |||
0 commit comments