Repository navigation
Commit be73f63
authored
fix(opencode): report a rejected run prompt exactly once (#25)
A rejected `session.prompt` / `session.command` request and the
`session.error` event the server publishes for it are the same failure
arriving on two channels. The event loop is already draining when the
request returns, so both could report it — or only one, depending on
whether the SSE subscription attached before the server published.
That made `--format json` stdout carry either one or two `error` records
for a single rejected request, which is what flaked
`--format json emits a pure error record for a rejected prompt request`.
First reporter wins now: the loop skips a session error the request path
already reported, and the request path stays silent if the loop got there
first. Neither path waits, so anomalyco#27371's prompt nonzero exit is unchanged.1 parent 2fedd66 commit be73f63
2 files changed
Lines changed: 30 additions & 4 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 | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
693 | 714 | | |
694 | 715 | | |
695 | 716 | | |
| |||
776 | 797 | | |
777 | 798 | | |
778 | 799 | | |
| 800 | + | |
| 801 | + | |
779 | 802 | | |
780 | 803 | | |
781 | 804 | | |
| |||
847 | 870 | | |
848 | 871 | | |
849 | 872 | | |
850 | | - | |
851 | | - | |
| 873 | + | |
852 | 874 | | |
853 | 875 | | |
854 | 876 | | |
| |||
864 | 886 | | |
865 | 887 | | |
866 | 888 | | |
867 | | - | |
868 | | - | |
| 889 | + | |
869 | 890 | | |
870 | 891 | | |
871 | 892 | | |
| |||
0 commit comments