summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-03-17 10:51:53 +0300
committerGrail Finder <wohilas@gmail.com>2026-03-17 10:52:42 +0300
commit69a69547ffed37d73d0416103025e6b16f5cb19b (patch)
tree790e6cbac9fb7317a8909909db424fa763dd01e5 /bot.go
parent326a1a4d094c6349e0403d479384347c52964537 (diff)
Fix: streaming to tuiHEADmaster
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go28
1 files changed, 6 insertions, 22 deletions
diff --git a/bot.go b/bot.go
index 4f5e6cf..384563e 100644
--- a/bot.go
+++ b/bot.go
@@ -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{}