tui fixes

This commit is contained in:
Luxferre
2026-03-23 00:06:24 +02:00
parent 4e43d84e2d
commit f931203cda
2 changed files with 19 additions and 2 deletions
+17 -1
View File
@@ -90,6 +90,22 @@ func (m model) userMessages() []string {
return msgs return msgs
} }
func filterHistory(h []sidekick.Message) []sidekick.Message {
var history []sidekick.Message
for _, msg := range h {
if msg.Role == sidekick.MessageRoleSystem {
// Filter out TUI-specific system messages that are for display only
if strings.HasPrefix(msg.Content, banner) ||
msg.Content == "Request cancelled." ||
strings.HasPrefix(msg.Content, "Error: ") {
continue
}
}
history = append(history, msg)
}
return history
}
type agentResponseMsg struct { type agentResponseMsg struct {
response string response string
err error err error
@@ -493,7 +509,7 @@ func (m *model) runAgent() tea.Cmd {
var ctx context.Context var ctx context.Context
ctx, m.cancel = context.WithCancel(context.Background()) ctx, m.cancel = context.WithCancel(context.Background())
return func() tea.Msg { return func() tea.Msg {
res, err := m.agent.Run(ctx, m.history, m.pool) res, err := m.agent.Run(ctx, filterHistory(m.history), m.pool)
return agentResponseMsg{response: res, err: err} return agentResponseMsg{response: res, err: err}
} }
} }
+2 -1
View File
@@ -23,7 +23,8 @@ port = 8080
[models.ollama] [models.ollama]
# model_id = "Jackrong/Qwen3.5-2B-Claude-4.6-Opus-Reasoning-Distilled-GGUF:Q4_K_M" # model_id = "Jackrong/Qwen3.5-2B-Claude-4.6-Opus-Reasoning-Distilled-GGUF:Q4_K_M"
model_id = "unsloth/Qwen3.5-0.8B-GGUF:Q8_0" # model_id = "nvidia/NVIDIA-Nemotron-3-Nano-4B-GGUF:Q4_K_M"
model_id = "Intel/Qwen3-Coder-30B-A3B-Instruct-gguf-q2ks-mixed-AutoRound"
# endpoint = "http://127.0.0.1:11434/v1" # endpoint = "http://127.0.0.1:11434/v1"
endpoint = "http://127.0.0.1:8080/v1" endpoint = "http://127.0.0.1:8080/v1"
api_key = "" api_key = ""