From 1480ffa9488635aade59c884874ee07b60edbe37 Mon Sep 17 00:00:00 2001 From: lxowalle Date: Tue, 14 Apr 2026 11:14:42 +0800 Subject: [PATCH] * delete history --- pkg/agent/loop.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 0c79f6daa..e1abbc6c7 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -1370,7 +1370,6 @@ func (al *AgentLoop) askSideQuestion( var channel, chatID, senderID, senderDisplayName string var media []string var activeSkills []string - var history []providers.Message var summary string if opts != nil { channel = opts.Channel @@ -1386,14 +1385,13 @@ func (al *AgentLoop) askSideQuestion( Budget: agent.ContextWindow, MaxTokens: agent.MaxTokens, }); err == nil && resp != nil { - history = resp.History summary = resp.Summary } } } messages := agent.ContextBuilder.BuildMessages( - history, + nil, // system instructions are not relevant for side questions summary, question, media, @@ -1446,7 +1444,11 @@ func (al *AgentLoop) askSideQuestion( if fbResult.Response == nil { return "", nil } - return fbResult.Response.Content, nil + content := fbResult.Response.Content + if content == "" && fbResult.Response.ReasoningContent != "" { + content = fbResult.Response.ReasoningContent + } + return content, nil } resp, err := callProvider(ctx, activeProvider, activeModel) @@ -1456,7 +1458,11 @@ func (al *AgentLoop) askSideQuestion( if resp == nil { return "", nil } - return resp.Content, nil + content := resp.Content + if content == "" && resp.ReasoningContent != "" { + content = resp.ReasoningContent + } + return content, nil } func (al *AgentLoop) processMessage(ctx context.Context, msg bus.InboundMessage) (string, error) {