diff options
| author | Grail Finder <wohilas@gmail.com> | 2025-12-28 22:50:13 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2025-12-28 22:50:13 +0300 |
| commit | 631c3b6a9b4c8b23f88885f257cd90ae1f45834a (patch) | |
| tree | a78ba6544944fd5346fbd581b1b4fdd32316b1d1 /bot.go | |
| parent | 033d9bf78ac5afdb2a95696742aea67018a54a17 (diff) | |
Fix: avoid forever loop
Diffstat (limited to 'bot.go')
| -rw-r--r-- | bot.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -684,8 +684,9 @@ out: toolResp.WriteString(toolChunk) tv.ScrollToEnd() case <-streamDone: - // rrain any remaining chunks from chunkChan before exiting - for chunk := range chunkChan { + // drain any remaining chunks from chunkChan before exiting + for len(chunkChan) > 0 { + chunk := <-chunkChan fmt.Fprint(tv, chunk) respText.WriteString(chunk) tv.ScrollToEnd() |
