Commit 471d17d
committed
fix(chat,sdk): attach the input router per run, not per chat
A worker process is reused across runs, and the executor tears the channel
subscription down at the end of each one. The router was cached per chat, so a
second run of the same chat in the same process skipped the attach and then had
no subscription feeding it: no messages arrived, and the conversation hung with
no error raised.
Caching it per run instead means every run attaches its own subscription, while a
nested `chat.createSession` inside one run still shares the router. Reported by
review, reproduced first as a failing test that drives two runs through one
process with the executor's teardown in between.1 parent 4693292 commit 471d17d
2 files changed
Lines changed: 75 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1871 | 1871 | | |
1872 | 1872 | | |
1873 | 1873 | | |
1874 | | - | |
1875 | | - | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
1881 | 1882 | | |
1882 | 1883 | | |
1883 | 1884 | | |
1884 | | - | |
| 1885 | + | |
1885 | 1886 | | |
1886 | 1887 | | |
1887 | 1888 | | |
| |||
2021 | 2022 | | |
2022 | 2023 | | |
2023 | 2024 | | |
| 2025 | + | |
2024 | 2026 | | |
2025 | 2027 | | |
2026 | 2028 | | |
2027 | | - | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
2028 | 2033 | | |
2029 | 2034 | | |
2030 | 2035 | | |
| 2036 | + | |
2031 | 2037 | | |
2032 | 2038 | | |
2033 | 2039 | | |
| |||
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments