tui fixes
This commit is contained in:
@@ -90,6 +90,22 @@ func (m model) userMessages() []string {
|
||||
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 {
|
||||
response string
|
||||
err error
|
||||
@@ -493,7 +509,7 @@ func (m *model) runAgent() tea.Cmd {
|
||||
var ctx context.Context
|
||||
ctx, m.cancel = context.WithCancel(context.Background())
|
||||
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}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -23,7 +23,8 @@ port = 8080
|
||||
|
||||
[models.ollama]
|
||||
# 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:8080/v1"
|
||||
api_key = ""
|
||||
|
||||
Reference in New Issue
Block a user