diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-03-17 10:51:53 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-03-17 10:51:53 +0300 |
| commit | 3e4213b5c39a18424e6d117d7967b1e9919e3402 (patch) | |
| tree | 2543329a16b38f1cf93470de26e43bab286aca6c /bot.go | |
| parent | 451e6f0381afe37c59f12703f8750407c27ba94a (diff) | |
Fix: streaming to tui
Diffstat (limited to 'bot.go')
| -rw-r--r-- | bot.go | 28 |
1 files changed, 6 insertions, 22 deletions
@@ -48,10 +48,9 @@ var ( chunkParser ChunkParser lastToolCall *models.FuncCall lastRespStats *models.ResponseStats - - outputHandler OutputHandler - cliPrevOutput string - cliRespDone chan bool + outputHandler OutputHandler + cliPrevOutput string + cliRespDone chan bool ) type OutputHandler interface { @@ -65,30 +64,15 @@ type TUIOutputHandler struct { } func (h *TUIOutputHandler) Write(p string) { - if h.tv != nil { - fmt.Fprint(h.tv, p) - } - if cfg != nil && cfg.CLIMode { - fmt.Print(p) - cliPrevOutput = p - } + fmt.Fprint(h.tv, p) } func (h *TUIOutputHandler) Writef(format string, args ...interface{}) { - s := fmt.Sprintf(format, args...) - if h.tv != nil { - fmt.Fprint(h.tv, s) - } - if cfg != nil && cfg.CLIMode { - fmt.Print(s) - cliPrevOutput = s - } + fmt.Fprintf(h.tv, format, args...) } func (h *TUIOutputHandler) ScrollToEnd() { - if h.tv != nil { - h.tv.ScrollToEnd() - } + h.tv.ScrollToEnd() } type CLIOutputHandler struct{} |
