Commit 94bb50b
committed
fix: make chanSend non-blocking to prevent panic on closed channel
The RAG file watcher runs for the lifetime of the agent but holds a
closure over the per-message events channel. When finalizeEventChannel
closes that channel between messages, the watcher panics with
"send on closed channel".
Make chanSend non-blocking with select/default and recover from panics
on closed channels, so late-arriving RAG events are safely dropped.
Fixes #2266
Assisted-By: docker-agent1 parent 2021b77 commit 94bb50b
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
580 | 584 | | |
581 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
582 | 592 | | |
0 commit comments